RobbieC
Active Member
- Joined
- Dec 14, 2016
- Messages
- 376
- Office Version
- 2010
- Platform
- Windows
Hi there, I have a range (BA103:DA114) and I am looking for a simple way to remove any blank rows. However, I only need this range of 10 rows to be in the equation as there are other cells to the left and right and also below this range which contain data... (if you get my drift)
I can delete entire rows using :
but this code not only deletes the blank rows in the range, but anything below in the column is shifted up by the number of rows deleted.
I only want this code to affect the range (BA103:DA114) and nothing to left or right or below...
If you can point me in the right direction, I'd be very grateful
Thanks
I can delete entire rows using :
Code:
Sub DeleteBlanks()
Dim intCol As Integer
With Worksheets("Sheet1")
For intCol = 1 To 20 'cols A to change for number of columns
.Range(.Cells(1, intCol), .Cells(10, intCol)). _
SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
Next intCol
End With
End Sub
but this code not only deletes the blank rows in the range, but anything below in the column is shifted up by the number of rows deleted.
I only want this code to affect the range (BA103:DA114) and nothing to left or right or below...
If you can point me in the right direction, I'd be very grateful
Thanks