G
Guest
hello, i am trying to do as below, but it says compile error, end with
without with? which seems silly to me but i am obviously doing something wrong
**********************************************************************
Sub PrintCode()
Dim i As Integer, c As Integer, Q As Integer
c = 0
With Sheets("MacroData")
For Q = 2 To 46
B = Cells(Q, 2).Value
End With
With Sheets("Salary ect")
For i = 1 To 10000
A = Left(Cells(i, 1), 3).Value
End With
If A = B Then
With Sheets("macrodata")
Cells(i, 5).Value = 1
End With
Next
End Sub
**********************************************************************
any help please,
thanks,
andy
without with? which seems silly to me but i am obviously doing something wrong
**********************************************************************
Sub PrintCode()
Dim i As Integer, c As Integer, Q As Integer
c = 0
With Sheets("MacroData")
For Q = 2 To 46
B = Cells(Q, 2).Value
End With
With Sheets("Salary ect")
For i = 1 To 10000
A = Left(Cells(i, 1), 3).Value
End With
If A = B Then
With Sheets("macrodata")
Cells(i, 5).Value = 1
End With
Next
End Sub
**********************************************************************
any help please,
thanks,
andy