How to set/expand row height of print area

aedctalk

Board Regular
Joined
Oct 9, 2010
Messages
156
Hi what i'm trying to do is is increase the row height of some rows only while i'm printing the the page... I'm trying to expand the rows to fit onto the page vertially pretty much.. so the boxes are larger and easier to write in.. ( dont want it to effect what my page on the computer looks like though.. only during printing. I've split our page into 2 pages

How can i increase row height? I'd like to use below formula.. BUT it is getting stuck on Wks.Rows(Row).RowHeight = 1

Also how would i set the numbers in my array to be B2:A53 for top as i want to resize every row.

Thank you so much for any input/help :)


Code:
Dim Wks As Worksheet
  
    Set Wks = ActiveSheet
    
    With Wks.PageSetup
      .printarea = "B2:A53"
      .FitToPagesTall = 1
      .FitToPagesWide = 1
    End With
    
      For Each Row In Array(7, 9, 12, 14, 17, 19, 21, 24, 26, 28, 31, 33)
        Wks.Rows(Row).RowHeight = 1
      Next Row
    
    Wks.PrintOut
    
     With Wks.PageSetup
      .printarea = "B55:AE90"
      .FitToPagesTall = 1
      .FitToPagesWide = 1
    End With
    
      For Each Row In Array(55, 90)
        Wks.Rows(Row).RowHeight = 23
      Next Row
    
    Wks.PrintOut
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I have no particular comment on your code.

What I do is create another sheet to print from,
then I'm not changing the formatting back and forth,
only updating cell values. Easier for me at least.
Just my 2 cents.
 
Upvote 0
Hi,

I am not that familiar with coding, but if you know how to use offset function it should help. Offset function will dynamically select the range as per the formula.
 
Upvote 0
warship. thanks i hadnt really thought of doing that.

think i'll go that route.. seems easier :0

Appreciate the idea :0
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,681
Members
452,937
Latest member
Bhg1984

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