How to change the row height if cell is empty???

PIsabel

Board Regular
Joined
Feb 4, 2014
Messages
124
Office Version
  1. 365
Platform
  1. Windows
I tried to find a code but I couldn't.
I need a macro that identifies the last occupied cell in column C and changes the height of the entire row if cell B is empty.
The sheet can have up to 15000 lines but this rarely happens.
Can someone help me?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
How about
VBA Code:
Sub Pisabel()
   With Range("B:B").SpecialCells(xlBlanks)
      .RowHeight = 15
   End With
End Sub
 
Upvote 1
apparently so simple but it worked spectacularly well.
What if I want to change the color of the columns A:E with the mm code?
I got the code to change the cell but the line was "better"
VBA Code:
Sub PIsabel()

   With Range("B:B").SpecialCells(xlBlanks)
    .RowHeight = 15
    .Interior.Color = 255
   End With

End Sub
 
Upvote 0
How about
VBA Code:
Sub Pisabel()
   With Range("B:B").SpecialCells(xlBlanks)
      .RowHeight = 15
      For Each Rng In .Areas
         Rng.Offset(, -1).Resize(, 5).Interior.Color = vbRed
      Next Rng
   End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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