Related:
- Hpagebreaks location
- 4 elements trainer - Download - Adult games
- Diablo 4 free download - Download - Role playing
- Gta 4 download - Download - Action and adventure
- Pluraleyes 4 download - Download - Video editing
- Fnaf 4 download pc - Download - Horror
1 response
RWomanizer
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120
May 11, 2011 at 03:37 AM
May 11, 2011 at 03:37 AM
Use the following code:
Sub Macro1() Dim sht As Worksheet For Each sht In Worksheets ActiveWindow.View = xlPageBreakPreview Set ActiveSheet.VPageBreaks(1).Location = Range("X1") Set ActiveSheet.HPageBreaks(1).Location = Range("A52") Set ActiveSheet.HPageBreaks(2).Location = Range("A90") Set ActiveSheet.HPageBreaks(3).Location = Range("a133") Set ActiveSheet.HPageBreaks(4).Location = Range("a150") ActiveWindow.View = xlNormalView Next sht End Sub
May 11, 2011 at 07:21 AM
It didn't succeed 100%, I faced a message (Run-Time error '1004')
But I discovered that I need first to unhide any hidden row then to apply this macro but I make some adjustments as follow:
Private Sub CommandButton3_Click()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Select
ActiveWindow.View = xlNormalView
ActiveWindow.View = xlPageBreakPreview
ws.ResetAllPageBreaks
Set ActiveSheet.HPageBreaks(1).Location = Range("A52")
Set ActiveSheet.HPageBreaks(2).Location = Range("A90")
Set ActiveSheet.HPageBreaks(3).Location = Range("a133")
Next ws
End Sub
But I need the Vertical as well, so if I added this to the above code I face the same message (Run-Time error '1004').
Set ActiveSheet.VPageBreaks(1).Location = Range("X1")
So what can I add to unhide first any hidden rows then to apply the macro?
Thank again for any help.