willyboy58
Technical User
I have a worksheet (“Branch 3”) with the following abbreviated info. I want to filter on the “Fund” column.
Branch Fund Number Name
3 1 1000 Bob
3 1 1111 Steve
3 1 1200 Dennis
3 4 2000 Jason
3 4 2222 Mark
3 4 2333 Curtis
With the following code I filter as desired, and then copy and paste the info for the three employees with Fund 4 (Jason, Mark and Curtis) onto the NOVA worksheet. So far, so good.
But I can’t seem to get my “Branch 3” worksheet to display only the remaining employees (Bob, Steve and Dennis). In other words, cut Jason, Mark and Curtis from the “Branch 3” worksheet. I’ve tried a number of different cut/copy/paste placements in the code, but with no success. I know it has to be simple.
Sub SeparateNovaFromSATL()
'this pro separates the Nova from the SATL clients and pastes them to their own sheet
Dim lRow As Long, origShtSatl As Worksheet
Windows("propnova.xls"
.Activate 'holds both Prop1 and Nova data
Sheets("Branch 3"
.Select
'don't need to insert headings b/c they are already there
Set origShtSatl = ActiveSheet
lRow = Range("A65536"
.End(xlUp).Row
With origShtSatl
.Range("A1:F" & lRow).AutoFilter Field:=1, Criteria1:="4" 'curVal
.Range("A1:F" & lRow).Copy
‘tried CutCopyMode = False in the line above
End With
Worksheets.Add
ActiveSheet.Name = "nova "
Range("A1"
.Select
Selection.PasteSpecial
Range("A1"
.Select
Columns("A:F"
.EntireColumn.AutoFit
Range("A1"
.Select
Sheets("Branch 3"
.Select
Selection.AutoFilter Field:=1, Criteria1:="1"
Application.CutCopyMode = False
Selection.AutoFilter
End Sub
As always, TIA
Bill
Branch Fund Number Name
3 1 1000 Bob
3 1 1111 Steve
3 1 1200 Dennis
3 4 2000 Jason
3 4 2222 Mark
3 4 2333 Curtis
With the following code I filter as desired, and then copy and paste the info for the three employees with Fund 4 (Jason, Mark and Curtis) onto the NOVA worksheet. So far, so good.
But I can’t seem to get my “Branch 3” worksheet to display only the remaining employees (Bob, Steve and Dennis). In other words, cut Jason, Mark and Curtis from the “Branch 3” worksheet. I’ve tried a number of different cut/copy/paste placements in the code, but with no success. I know it has to be simple.
Sub SeparateNovaFromSATL()
'this pro separates the Nova from the SATL clients and pastes them to their own sheet
Dim lRow As Long, origShtSatl As Worksheet
Windows("propnova.xls"
Sheets("Branch 3"
'don't need to insert headings b/c they are already there
Set origShtSatl = ActiveSheet
lRow = Range("A65536"
With origShtSatl
.Range("A1:F" & lRow).AutoFilter Field:=1, Criteria1:="4" 'curVal
.Range("A1:F" & lRow).Copy
‘tried CutCopyMode = False in the line above
End With
Worksheets.Add
ActiveSheet.Name = "nova "
Range("A1"
Selection.PasteSpecial
Range("A1"
Columns("A:F"
Range("A1"
Sheets("Branch 3"
Selection.AutoFilter Field:=1, Criteria1:="1"
Application.CutCopyMode = False
Selection.AutoFilter
End Sub
As always, TIA
Bill