Set Row Height of n+nth Rows Only If Previous Cell Has A Value

bearwires

Board Regular
Joined
Mar 25, 2008
Messages
57
Office Version
  1. 365
Platform
  1. Windows
I need to set the row height of specific rows, starting at Row 33 and ending at Row 2208, with the offset of each row from the last being 29.
It must only perform the row height change if there is a value in the previous cell in column B.

i.e.
Set Row Height for Cells B33, B62, B91, B120, B149,........B2208 = 40, If the cell before it has a value (text string) -->B32, B61, B90, B119, B148........B2207 = "Text String"

But, If the cell before it has no text string value (has formula but blank), skip the row height change for that row.

Hope that makes sense.


Can anyone provide VBA code to achieve this please?

Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I need to set the row height of specific rows, starting at Row 33 and ending at Row 2208, with the offset of each row from the last being 29.
It must only perform the row height change if there is a value in the previous cell in column B.

i.e.
Set Row Height for Cells B33, B62, B91, B120, B149,........B2208 = 40, If the cell before it has a value (text string) -->B32, B61, B90, B119, B148........B2207 = "Text String"

But, If the cell before it has no text string value (has formula but blank), skip the row height change for that row.

Hope that makes sense.


Can anyone provide VBA code to achieve this please?

Thanks
Mods, this Thread can be deleted as the answer is on another thread......Solution
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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