Excel Data file help

%3CLINGO-SUB%20id%3D%22lingo-sub-1642730%22%20slang%3D%22en-US%22%3EExcel%20Data%20file%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1642730%22%20slang%3D%22en-US%22%3E%3CP%3EGreetings%2C%20I%20have%20a%20data%20file%20of%201000%20rows%2C%26nbsp%3B%20The%20height%20of%20the%20rows%20is%2025.%26nbsp%3B%20The%20problem%20is%20the%20blank%20rows%20are%20also%2025.%26nbsp%3B%20%26nbsp%3BCan%20you%20tell%20me%20how%20I%20can%20reduce%20the%20ROW%20HEIGHT%20on%20the%20BLANK%20rows%20only%3F%26nbsp%3B%20Is%20this%20even%20possible%3F%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3CP%3EMargaret%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1642730%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1642924%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Data%20file%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1642924%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F785076%22%20target%3D%22_blank%22%3E%40Magpie10011%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Erecord%20a%20macro%20then%20stop%20the%20recording%2C%20copy%20paste%20this%20code%20instead%20of%20the%20recorded%20macro%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3ESub%20Macro1()%0A'source%20https%3A%2F%2Fwww.excel-easy.com%2Fvba%2Fexamples%2Floop-through-entire-column.html%0A%0A%0ADim%20i%20As%20Long%0AFor%20i%20%3D%201%20To%201000%0AIf%20IsEmpty(Cells(i%2C%201).Value)%20Then%0ACells(i%2C%201).RowHeight%20%3D%205%0AEnd%20If%0A%0ANext%20i%0A%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20change%20the%20row%20height%20from%205%20to%20any%20value%3C%2FP%3E%3CP%3EYou%20can%20iterate%20between%201%20to%201000%20or%20you%20can%20change%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20it%20solves%20your%20problem%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Greetings, I have a data file of 1000 rows,  The height of the rows is 25.  The problem is the blank rows are also 25.   Can you tell me how I can reduce the ROW HEIGHT on the BLANK rows only?  Is this even possible?

Thank you

Margaret

1 Reply
Highlighted

@Magpie10011 

 

record a macro then stop the recording, copy paste this code instead of the recorded macro

 

Sub Macro1()
'source https://www.excel-easy.com/vba/examples/loop-through-entire-column.html


Dim i As Long
For i = 1 To 1000
If IsEmpty(Cells(i, 1).Value) Then
Cells(i, 1).RowHeight = 5
End If

Next i

End Sub

 

You can change the row height from 5 to any value

You can iterate between 1 to 1000 or you can change it.

 

 

Hope it solves your problem