If then row height set macro

doriannjeshi

Active Member
Joined
Apr 5, 2015
Messages
338
Office Version
  1. 365
Platform
  1. Windows
Hello,
I need for the cells that have content in column A if not duplicate value of the cell in column A to have row height of 30.

a111
a111
a111
a114
a115
a116
a117
a118
a119
a119
a118
a118
a118
a123
a124
a125
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Can we make the macro so doesn't return an error when it doesnt find a unique value in column A ?
 
Upvote 0
Does this work for you?
VBA Code:
Sub SetRowheight()
    Dim rng As Range
    Set rng = Range("A:A").SpecialCells(xlCellTypeBlanks)
    rng.EntireRow.RowHeight = 30
End Sub
 
Upvote 0
I need for the cells that have content in column A if not duplicate value of the cell in column A to have row height of 30.
Did you try the macro in post #10?

In your example, which rows should be set at height 30?
Libro1
A
1a111
2a111
3a111
4
5a114
6
7a115
8
9a116
10
11a117
12
13a118
14
15a119
16a119
17
18a118
19a118
20a118
21
22a123
23
24a124
Hoja1

Could you specify the numbers of rows to which you want to increase the row size?

:unsure:
 
Upvote 0
Hi Dante,
The solution provided by HighandWilder is the one I asked
Your solution increases the height of the first cell unique or not, which also comes in handy for other scenarios,
Thank you
 
Last edited:
Upvote 0
Well the problem was if possible to not return error in HighandWilder macro , if not no problem.
But if it returns an error then your request is not resolved. I would like to help you, but I need you to explain in your example which rows you need to apply the row increase to.
 
Upvote 0
@DanteAmor It needs to apply row increase to each unique value in A column

I need a workaround in applying this macro 3 times in a bigger macro
with dim as.. as they are repetead .
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,862
Messages
6,181,465
Members
453,045
Latest member
Abraxas_X

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