G
Guest
The I am still having problems with my macro,
this is a a module within my macro,
************************************************************
Sub PrintCode()
Dim i As Integer, c As Integer, Q As Integer
c = 0
For Q = 2 To 2
With Sheets("MacroData")
B = .Cells(Q, 2).Value
End With
For i = 1 To 10000
With Sheets("Salary etc")
A = Left(.Cells(i, 1), 3)
End With
If A = B Then
With Sheets("MacroData")
c = c + 1
.Cells(i, 5).Value = c
.Cells(i, 7).Value = 1
End With
End If
Next i
With Sheets("MacroData")
D = .Range("G2").Value
E = .Range("H2").Value
End With
With Sheets("Salary etc")
**.Range("A1:R4", D & ":" & E).Select***
.Selection.Print
End With
Next Q
End Sub
************************************************************
The part near the end of the macro highlighted with **.** gets highlighted,
with
select method, range class
the error,
It is very close to being finished.
Many thanks,
Andy
this is a a module within my macro,
************************************************************
Sub PrintCode()
Dim i As Integer, c As Integer, Q As Integer
c = 0
For Q = 2 To 2
With Sheets("MacroData")
B = .Cells(Q, 2).Value
End With
For i = 1 To 10000
With Sheets("Salary etc")
A = Left(.Cells(i, 1), 3)
End With
If A = B Then
With Sheets("MacroData")
c = c + 1
.Cells(i, 5).Value = c
.Cells(i, 7).Value = 1
End With
End If
Next i
With Sheets("MacroData")
D = .Range("G2").Value
E = .Range("H2").Value
End With
With Sheets("Salary etc")
**.Range("A1:R4", D & ":" & E).Select***
.Selection.Print
End With
Next Q
End Sub
************************************************************
The part near the end of the macro highlighted with **.** gets highlighted,
with
select method, range class
the error,
It is very close to being finished.
Many thanks,
Andy