walkerke2
07-25-2008, 01:44 AM
Hi All,
I have been using and trying to expand on some code that XLD had provided. I was looking to filter out names on a sheet and add them to another new sheet.
As being a newbie I would like to add more code and process other sheets alike.
The code below is giving me error's on Sheet name and range.. See sheet example.
CheersSub Auditor_workflow()
Dim rng As Range
Dim sh As Worksheet
Dim target As Worksheet
Set ActiveSheet.Name = "SMEB_ALL"
Set target = Worksheets.Add
With sh
Set rng = Range(.Range("J1"), .Range("J1").End(xlDown))
.Columns("J:J").AutoFilter Field:=1, Criteria1:="HA*"
rng.EntireRow.Copy target.Range("A1")
.Columns("D:D").AutoFilter
ActiveSheet.Name = "Auditor Workflow"
Columns.Select
Selection.Rows.Autofit
Selection.Columns.Autofit
End With
End Sub
I have been using and trying to expand on some code that XLD had provided. I was looking to filter out names on a sheet and add them to another new sheet.
As being a newbie I would like to add more code and process other sheets alike.
The code below is giving me error's on Sheet name and range.. See sheet example.
CheersSub Auditor_workflow()
Dim rng As Range
Dim sh As Worksheet
Dim target As Worksheet
Set ActiveSheet.Name = "SMEB_ALL"
Set target = Worksheets.Add
With sh
Set rng = Range(.Range("J1"), .Range("J1").End(xlDown))
.Columns("J:J").AutoFilter Field:=1, Criteria1:="HA*"
rng.EntireRow.Copy target.Range("A1")
.Columns("D:D").AutoFilter
ActiveSheet.Name = "Auditor Workflow"
Columns.Select
Selection.Rows.Autofit
Selection.Columns.Autofit
End With
End Sub