decadence
Well-known Member
- Joined
- Oct 9, 2015
- Messages
- 525
- Office Version
- 365
- 2016
- 2013
- 2010
- 2007
- Platform
- Windows
Hi I am trying to figure out how to delete rows after data, but I need to change it so "B" is a Variable like the code I am using. Can someone help with this please.
My Code
What I need is to incorporate my code into the one below
My Code
Code:
[COLOR="#DAA520"]Rng.Resize(Cells(Rows.Count, Rng.Column).End(xlUp).row)[/COLOR]
What I need is to incorporate my code into the one below
Code:
Dim WS As Worksheet
Dim LastCell As Range
Dim LastCellRowNumber As Long
Set WS = Worksheets("Sheet1")
With WS
Set LastCell = [COLOR="#DAA520"].Cells(.Rows.Count, "B").End(xlUp)[/COLOR]
LastCellRowNumber = LastCell.Row
Rows(LastCellRowNumber + 1 & ":" & Rows.Count).Delete
End With