I may be posting in the wrong area but probably someone here can help. I am writing VBA code to do the following:
IF A1 > 50 then print array C1:E1
I have this code and it works.
Sub Test()
If Range("A1") > 50 Then
ActiveSheet.PageSetup.PrintArea = "c1:e7"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End If
Call cler_print
End Sub
Sub cler_print()
ActiveSheet.PageSetup.PrintArea = ""
End Sub
Now, I want to be able to do the same for the following:
If A10>50 then print C10:E17
If A21>50 then print C21:E30 and so on
Question: can a series of such commands be included in one code activated by one MACRO button? If so, how does one write a series of cases testing the values in a series of cells to deterine if an associated array can be printed?
I have tried to do this repeatedly and cannot find the right syntax that will trigger a series of tests.
In the end, I want to user to complete a checklist - then click a MACRO button that will print arrays of information if the values in specific cells meet the criterion >50. I want the code to 'test' the values in 6 different cells and to print, based on compliance with the criterion, 6 different arrays of information.
I'm under the gun and am stalled. People are waiting on my solution and I can't seem to move forward as I am not too familiar with VBA.
Can and will anyone HELP???
Best regards...I know you are all busy!!
Bill (please respond to bmansfield@hscdsb.on.ca)