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-comfficeffice" /><o></o>
<o> </o>
With ActiveSheet<o></o>
.Unprotect Password:="hillary" 'password bit optional<o></o>
.Range("A:A,K:K,L:L,M:M,N:N,O:O").EntireColumn.Hidden = True<o></o>
.PrintOut Copies:=1, Collate:=True<o></o>
.Range("A:A,K:K,L:L,M:M,N:N,O:O").EntireColumn.Hidden = False<o></o>
.Protect Password:="hillary"<o></o>
End With<o></o>
<o> </o>
End Sub
<o> </o>
<o> </o>
Sub Macro2()<o></o>
With ActiveSheet<o></o>
.Unprotect Password:="hillary" 'password bit optional<o></o>
.Range("F:F,H:H,I:I,J:J,M:M,N:N").EntireColumn.Hidden = True<o></o>
.PrintOut Copies:=1, Collate:=True<o></o>
.Range("F:F,H:H,I:I,J:J,M:M,N:N").EntireColumn.Hidden = False<o></o>
.Protect Password:="hillary"<o></o>
End With<o></o>
<o> </o>
End Sub
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-comfficeffice" /><o></o>
<o> </o>
With ActiveSheet<o></o>
.Unprotect Password:="hillary" 'password bit optional<o></o>
.Range("A:A,K:K,L:L,M:M,N:N,O:O").EntireColumn.Hidden = True<o></o>
.PrintOut Copies:=1, Collate:=True<o></o>
.Range("A:A,K:K,L:L,M:M,N:N,O:O").EntireColumn.Hidden = False<o></o>
.Protect Password:="hillary"<o></o>
End With<o></o>
<o> </o>
End Sub
<o> </o>
<o> </o>
Sub Macro2()<o></o>
With ActiveSheet<o></o>
.Unprotect Password:="hillary" 'password bit optional<o></o>
.Range("F:F,H:H,I:I,J:J,M:M,N:N").EntireColumn.Hidden = True<o></o>
.PrintOut Copies:=1, Collate:=True<o></o>
.Range("F:F,H:H,I:I,J:J,M:M,N:N").EntireColumn.Hidden = False<o></o>
.Protect Password:="hillary"<o></o>
End With<o></o>
<o> </o>
End Sub