MACRO printing empty cells

Mike Hughes

New Member
Joined
Feb 9, 2009
Messages
5
I have two macros. Macro1 only prints worksheet cells which contain data whild Macro2 prints all cells in the workbook.

The Macro2 are just alike (except for the columns selected) so I don't understand why.

Would someone please help me? Thanks Mike

Here are the two Macros

Sub Macro1()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p> </o:p>
With ActiveSheet<o:p></o:p>
.Unprotect Password:="hillary" 'password bit optional<o:p></o:p>
.Range("A:A,K:K,L:L,M:M,N:N,O:O").EntireColumn.Hidden = True<o:p></o:p>
.PrintOut Copies:=1, Collate:=True<o:p></o:p>
.Range("A:A,K:K,L:L,M:M,N:N,O:O").EntireColumn.Hidden = False<o:p></o:p>
.Protect Password:="hillary"<o:p></o:p>
End With<o:p></o:p>
<o:p> </o:p>
End Sub
<o:p> </o:p>
<o:p> </o:p>
Sub Macro2()<o:p></o:p>
With ActiveSheet<o:p></o:p>
.Unprotect Password:="hillary" 'password bit optional<o:p></o:p>
.Range("F:F,H:H,I:I,J:J,M:M,N:N").EntireColumn.Hidden = True<o:p></o:p>
.PrintOut Copies:=1, Collate:=True<o:p></o:p>
.Range("F:F,H:H,I:I,J:J,M:M,N:N").EntireColumn.Hidden = False<o:p></o:p>
.Protect Password:="hillary"<o:p></o:p>
End With<o:p></o:p>
<o:p> </o:p>
End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,224,525
Messages
6,179,314
Members
452,905
Latest member
deadwings

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top