siladinlol
New Member
- Joined
- Jan 9, 2014
- Messages
- 4
Hello,
First time posting on this site and not too familiar with VBA excel, been learning just from trial and error.
I have an excel spreadsheet with 3 columns and 40 rows, my code takes the information from WeeklyScheduleNew's first row and inserts it into the tab "0'' - 8.75'' FMM" which is set up like a label, then the code prints that sheet for me and moves to the next row. Problem is I have multiple sheets that are for different sizes and need a way for the code to not print a row if it has a size over 9.
Here is my code:
Sub PrintMacro()
Dim i As Integer
For i = 1 To 40
Worksheets("0'' - 8.75'' FMM").Range("B2").Value = _
Worksheets("WeeklyScheduleNew").Range("C" & i).Value
Worksheets("0'' - 8.75'' FMM").Range("B3").Value = _
Worksheets("WeeklyScheduleNew").Range("A" & i).Value
Worksheets("0'' - 8.75'' FMM").Range("C3").Value = _
Worksheets("WeeklyScheduleNew").Range("B" & i).Value
Worksheets("0'' - 8.75'' FMM").Range("B4").Value = _
Worksheets("WeeklyScheduleNew").Range("D" & i).Value
ActiveSheet.PrintPreview
Next i
End Sub
Hope this is clear, please help with this problem.
Thanks
First time posting on this site and not too familiar with VBA excel, been learning just from trial and error.
I have an excel spreadsheet with 3 columns and 40 rows, my code takes the information from WeeklyScheduleNew's first row and inserts it into the tab "0'' - 8.75'' FMM" which is set up like a label, then the code prints that sheet for me and moves to the next row. Problem is I have multiple sheets that are for different sizes and need a way for the code to not print a row if it has a size over 9.
Here is my code:
Sub PrintMacro()
Dim i As Integer
For i = 1 To 40
Worksheets("0'' - 8.75'' FMM").Range("B2").Value = _
Worksheets("WeeklyScheduleNew").Range("C" & i).Value
Worksheets("0'' - 8.75'' FMM").Range("B3").Value = _
Worksheets("WeeklyScheduleNew").Range("A" & i).Value
Worksheets("0'' - 8.75'' FMM").Range("C3").Value = _
Worksheets("WeeklyScheduleNew").Range("B" & i).Value
Worksheets("0'' - 8.75'' FMM").Range("B4").Value = _
Worksheets("WeeklyScheduleNew").Range("D" & i).Value
ActiveSheet.PrintPreview
Next i
End Sub
Hope this is clear, please help with this problem.
Thanks