Find Text and Resize Row Height - VBA

jwb1012

Board Regular
Joined
Oct 17, 2016
Messages
167
Hello, I am attempting to find a code that goes through all worksheets in activeworkbook and searches column C for the term "Method of Quoting:", when it is found, I would like to resize that row height to 100.

Is this possible?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
That will always be the only text in the cell in column C.
Give this macro a try...
Code:
Sub EnlargeMethodOfQuoting()
  Columns("C").Replace "Method of Quoting:", "#N/A", xlWhole
  Columns("C").SpecialCells(xlConstants, xlErrors).RowHeight = 100
  Columns("C").Replace "#N/A", "Method of Quoting:", xlWhole
End Sub
 
Upvote 0
Hmm.. it replaces my "Method of Quoting:" with #N/A and then results in "Run-time Error 1004: No cells were found on the second line (adjusting row height)
 
Last edited:
Upvote 0
Hmm.. it replaces my "Method of Quoting:" with #N/A and then results in "Run-time Error 1004: No cells were found on the second line (adjusting row height)
What is in the cells of Column C, constants or formulas? If formulas, change that second line to this...

Columns("C").SpecialCells(xlFormulas, xlErrors).RowHeight = 100
 
Upvote 0
Excel 2013. Right now there are 200 rows. Method of quoting only appears once though.
I don't understand why that code did not work for you then... it worked fine for me in the test I did before posting that code. However, since there is only one occurrence of that text in the column, this much simpler macro should work for you...
Code:
[table="width: 500"]
[tr]
	[td]Sub EnlargeMethodOfQuoting()
  Columns("C").Find("Method of Quoting:", , xlValues, xlWhole).RowHeight = 100
End Sub[/td]
[/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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