I am trying to get my macro to work - and I can't seem to figure out what is wrong. The steps I want it to perform are to duplicate the GL Activity sheet; rename it as the CC integer; then delete the rows which are not the CC integer in the new GL tabs. I know the delete function is the problem - I just don't know what to do. Any help would be appreciated.
Dim i As Integer
Dim j As Integer
Dim Count_CC As Integer
Dim Count_GL As Integer
Count_GL = Worksheets("GL Activity").Used Range.Rows.Coun t
Count_CC = Worksheets("cc list").UsedRang e.Rows.Count
For i = 1 To Count_CC
Worksheets("GL Activity").Copy after:=Sheets(W orksheets.Count )
ActiveSheet.Nam e = Worksheets("cc list").Cells(i, 1).Value
For j = 1 To Count_GL
If ActiveSheet.Cel ls(j, 4).Value <> i Then
ActiveSheet.Cel ls(j, 4).EntireRow.De lete = True
Else
End If
Next j
Next i
End Sub
Dim i As Integer
Dim j As Integer
Dim Count_CC As Integer
Dim Count_GL As Integer
Count_GL = Worksheets("GL Activity").Used Range.Rows.Coun t
Count_CC = Worksheets("cc list").UsedRang e.Rows.Count
For i = 1 To Count_CC
Worksheets("GL Activity").Copy after:=Sheets(W orksheets.Count )
ActiveSheet.Nam e = Worksheets("cc list").Cells(i, 1).Value
For j = 1 To Count_GL
If ActiveSheet.Cel ls(j, 4).Value <> i Then
ActiveSheet.Cel ls(j, 4).EntireRow.De lete = True
Else
End If
Next j
Next i
End Sub