Printing Selected Columns from Multiple Sheets

Closed
Redza Kalam - Jan 1, 2016 at 12:24 AM
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 - Jan 1, 2016 at 03:18 AM
Good day,

I recently made a workbook with multiple sheets. I am a newbie regarding Excel.

I would like to know if there is a way for me to have only columns A, L and O-Q to appear on paper when i print?

Thank you.

1 response

vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 259
Jan 1, 2016 at 03:18 AM
Hello Redza Kalam,

Perhaps the following code may be what you are wanting:-

Sub PrintIt()

Application.ScreenUpdating = False

Dim ws As Worksheet

For Each ws In Worksheets
       ws.Columns("B:K").EntireColumn.Hidden = True
       ws.Columns("M:N").EntireColumn.Hidden = True
       ws.PrintOut
       ws.Columns("B:K").EntireColumn.Hidden = False
       ws.Columns("M:N").EntireColumn.Hidden = False
Next ws

Application.ScreenUpdating = True

End Sub


The code hides the columns that you don't want to print, prints the columns that you do want to print and then unhides all the hidden columns.

I'm not sure of the extent of your dataset, but following is a link to my test work book which will give you an idea of how it works. Click on the Print button to see it work.

https://www.dropbox.com/s/i1vepf20o0g9r3f/RedzaKalam%28Print%20selected%20columns%20in%20multiple%20sheets%29.xlsm?dl=0

I hope that this helps.

Cheerio,
vcoolio.
0