Print routine needed for code

P

pano

Hi I hope someone can help me with this I want to run this on a sheet
carlog before printing but I cant work out how to put the print
routine in, anyone!!!!

Sub HideRows()
Dim i As Long
Application.ScreenUpdating = False
For i = 10 To 44
For j = 10 To 44
If Range("A" & i).Value = "" Then
Range("A" & i).EntireRow.Hidden = True
End If
If Range("b" & j).Value = 0 Then
Range("b" & j).EntireRow.Hidden = True
End If
Next 'i
Next 'j

Application.ScreenUpdating = True

End Sub
 
G

Guest

If the macro does what you want then put it in the 'Before print, event.

Double click this workbook in VB editor. Select workbook from the dropdown
and then 'before print' from the other dropdown and paste your code in.

Mike
 
P

pano

If the macro does what you want then put it in the 'Before print, event.

Double click this workbook in VB editor. Select workbook from the dropdown
and then 'before print' from the other dropdown and paste your code in.

Mike








- Show quoted text -

Thanks for that
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top