CopyRowHeight

Copy row height from row to another
Used to fix row heights or merged cells to adjust as needed
Works for 1 row at a time, but can be modified to accept range of rows


Public

Tested

My Own Work
Function CopyRowHeight(FromRow, ToRow, Optional FromSheet = "Active", Optional ToSheet = "Active", Optional WB = "This")
   ' Copy row height from row to another
' Used to fix row heights
'
' Example: CopyRowHeight 3, 10
' Example: CopyRowHeight 152, 152, "TemplateSheet", "Working 2019-07"
If WB = "This" Then WB = ThisWorkbook.Name
   If FromSheet = "Active" Then FromSheet = Workbooks(WB).ActiveSheet.Name
   If ToSheet = "Active" Then ToSheet = Workbooks(WB).ActiveSheet.Name
   
Workbooks(WB).Worksheets(ToSheet).Range("A" & ToRow).RowHeight = Workbooks(WB).Worksheets(FromSheet).Range("A" & FromRow).RowHeight

   'For I = Rows1 To Rows2
   '   Worksheets(Shee1).Range("A" & I).RowHeight = Worksheets(Shee2).Range("A" & I).RowHeight
   'Next
End Sub


FromRow, ToRow, Optional FromSheet = "Active", Optional ToSheet = "Active", Optional WB = "This"

Views 1043 Downloads 347

VBA-Excel Layout+Design
ANmarAmdeen
755
Attachments
Revisions

v1.0