Conditional Formatting 4 Columns
I think I'd check to see if that cell was empty first.
if .range("B2").value = "" then
.rows(2).delete
end if
Application.Goto .Range("a1"), Scroll:=True
.range("b2").select
ActiveWindow.FreezePanes = True
.UsedRange.Columns.AutoFit
Just in case that "padded row" was actually used.
David wrote:
Dave Peterson wrote
If you use formulas that look like:
=sheet1!a1
You'll see that they return a 0 if A1 is empty.
I like this formula better:
=if(sheet1!a1="","",sheet1!a1)
Then my "padded" range looks empty. This won't change the results of the
macro--you'll see blanks instead of 0's, though.
I opted for this "dirty" fix toward the end of the macro:
Application.Goto .Range("a1"), Scroll:=True
.Range("b2").Select
ActiveWindow.FreezePanes = True
.Rows(2).Delete '<---
.UsedRange.Columns.AutoFit
--
David
--
Dave Peterson
|