jblonde002
Board Regular
- Joined
- Jun 10, 2014
- Messages
- 61
I have some VBA in a workbook that I didn't create but need to edit. The issue faced is that at the moment it is referencing a count of the number of rows in column T to determine how many times to loop the printing (which is always 15 rows). However I want to use the value in cell U2 to determine how many times to loop through for example if U2 has the number 5 for the code to loop five times.
Can anyone explain how I might achieve that? Many thanks...
Can anyone explain how I might achieve that? Many thanks...
Code:
If MsgBox("Are you sure you want to print ALL the Progress Trackers for the teacher you have selected?", vbYesNo) = vbYes Then Dim i As Long
For i = 1 To Sheets("Codes").Cells(Rows.Count, "T").End(xlUp).Row
With Sheets("My Classes")
.Range("K3").Value = Sheets("Codes").Cells(i, "T").Value
Application.Calculate
.PrintOut '
End With
Next i