Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 84
Default Print routine needed for code


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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default Print routine needed for code

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

"pano" wrote:


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


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 84
Default Print routine needed for code

On Feb 11, 9:57 pm, Mike wrote:
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



"pano" wrote:

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- Hide quoted text -


- Show quoted text -


Thanks for that

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print separate reports with same column heading [email protected] Excel Discussion (Misc queries) 4 September 1st 06 09:46 PM
Conditional formats don't print Mark Lincoln Excel Discussion (Misc queries) 0 August 25th 06 06:26 PM
XL print preview should show grayscale if chosen on color printer Mick Excel Discussion (Misc queries) 0 December 3rd 05 09:28 PM
changing print area in an entire workbook lschuh Excel Worksheet Functions 7 August 4th 05 02:52 PM
Varying page Excel report judypudy Excel Discussion (Misc queries) 6 July 13th 05 08:39 PM


All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"