Macro help needed

  • Thread starter Thread starter Old_skills_lost
  • Start date Start date
O

Old_skills_lost

I have created a macro in 2007 and it is having someproblems in 2003 and I
cannot find the problem in the macro. Can someone help me please. Thank you
ahead

Sub Activities()
Dim cell As Range
Count = 0
Do While Count < 296
Count = Count + 1
Sheets("First Quarter Activities").Activate
For Each cell In Range("g4:g300")
If cell.Text = "won" Then
cell.Select
Rows(cell.Row).Cut
Sheets("Won").Activate
Range("A4").Activate
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
Sheets("First Quarter Activities").Activate
Else
If cell.Text = "lost" Then
cell.Select
Rows(cell.Row).Cut
Sheets("Lost").Activate
Range("A4").Activate
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
Sheets("First Quarter Activities").Activate
End If
End If
Next cell
Loop
End Sub
 
The trick is to work from the bottom up. Try this instead

Sub activites1()
On Error Resume Next
For i = cells(rows.count,"g").end(xlup).row To 4 Step -1
Select Case UCase(Cells(i, "g"))
Case Is = "W": sh = "Won"
Case Is = "L": sh = "Lost"
Case Else
End Select
Rows(i).Cut
Sheets(sh).Range("A4").Insert Shift:=xlDown
Next i
End Sub
 
Back
Top