VBA Help: Automatically resize all rows containing specific calculated value in a column

tyfy95

New Member
Joined
Nov 17, 2018
Messages
2
Hello MrExcel community :)

I am searching for a solution to resize all of the rows in a worksheet based on the calculated value in column H. I have used column H a conditional formatting helper. In this case, the only two values in column H are "None" and "Color". These values are being returned from an if statement that I wrote. Anyway, I have conditionally formatted the sheet to color fill all rows containing "Color" in column H but I also want to resize these to basically create a thick border as conditional formatting only has thin boarders.

If someone could help me write a sub procedure to find all rows with "Color" in column H and resize them I would be extremely grateful as I have not found an easy solution at the moment. Also, as I add more data, the amount of "Color" and "None" values will change as well.


Thank you!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi & welcome to MrExcel.
How about
Code:
Sub ResizeRws()
   With Range("A2", Range("A" & Rows.Count).End(xlUp))
      .Replace "Color", True, xlWhole, , False, , False, False
      .SpecialCells(xlConstants, xlLogical).EntireRow.RowHeight = 5
      .Replace True, "Color", xlWhole, , False, , False, False
   End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,792
Members
448,994
Latest member
rohitsomani

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