View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jarek Kujawa[_2_] Jarek Kujawa[_2_] is offline
external usenet poster
 
Posts: 896
Default hide columns before printing

press ALT+F11 to get to VBA
then in Project-VBA Project window double click on ThisWorkbook
put this code into the window to the right:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Range("A:B").Columns.Entirecolumn.Hidden = True
End Sub


HIH
pls click YES if it helped


On 15 Kwi, 08:24, "Jean-Paul De Winter"
wrote:
Hi,

Before actually printing my sheet I want to hide column A and B.
Can I do this automatically without having to hide them manually?

Thanks

--

Mvg.
Jean-Paul De Winter