I got the following code from another thread, but need to make a small change to better fit my need. The assumption of this code is that entire rows are blank. It works in column A, but I need it to work in whatever column I have selected. Sometimes, I have blank cells on rows where other data resides, but it's OK to kill the other data in order to be rid of the blanks. How can I change the following code to work in whatever column I have selected?
Notes:
1 - I can't sort by the blanks, then delete those rows, because the data needs to remain in its output sequence.
2 - Outside of this bit of code, I have a column variable that identifies the selected column (col = ActiveCell.Column).
3 - I tried changing the "A" to something else, but it still continued to work on column A.
I know the answer is probably very obvious, but I'm just not seeing it.
Notes:
1 - I can't sort by the blanks, then delete those rows, because the data needs to remain in its output sequence.
2 - Outside of this bit of code, I have a column variable that identifies the selected column (col = ActiveCell.Column).
3 - I tried changing the "A" to something else, but it still continued to work on column A.
Code:
For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
If cells(i, 1).Value = "" Then cells(i, 1).EntireRow.Delete
Next i
I know the answer is probably very obvious, but I'm just not seeing it.