Macro to set all rows to the height in column A

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

I need a macro than can set all the rows in range A8:A308 to the row height in there cell

So I've set row heights in each cell of range A8:A308 i want a macro to go down the rows and set the height of each row to whats in columnA

please help if you can

Thanks

Tony
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Not sure I understand what you want.
If you've already set the row height, why do you need a macro? :unsure:
 
Upvote 0
ok so i have revised what i need and this is now what i want,
A macro to go down the range and if value in column A does not match value in columnB then set that rows height to value in A
i realise this is alittle different to what i said above but should be quicker.
hope that helps
 
Upvote 0
How about
VBA Code:
Sub tonywatson()
   Dim Cl As Range
   
   For Each Cl In Range("A8", Range("A" & Rows.Count).End(xlUp))
      If Cl.Value <> Cl.Offset(, 1).Value Then Cl.RowHeight = Cl.Value
   Next Cl
End Sub
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,844
Members
449,051
Latest member
excelquestion515

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