The first macro below, select any cell in the column you want to "scan" for zero, and run the macro
'----------------------------------------------------
Sub fine_zero_and_delete_row(
Dim tmp As Strin
Dim tmp2 As Singl
With Selectio
tmp = Application.Intersect(.CurrentRegion, ActiveSheet.Columns(.Column)).Addres
End Wit
With Range(tmp
For tmp2 = .Rows.Count To 1 Step -
If .Cells(tmp2).Value = 0 Then .Rows(tmp2).Delet
Nex
End Wit
End Su
'----------------------------------------------------------------
For the second task, I'm not sure whether you want to "replace" the non-blank cells in a columns, OR, you have a table with many columns and one of them is empty
If you want to "replace" non-blank cells, try the one below
Select any cell in the column you want to fill (replace non-blank cells), and run the macro
'----------------------------------------------------------------
Sub fill_to_bottom(
Dim tmp As Singl
Application.ScreenUpdating = Fals
tmp =
With Selection.Cells(1
Do Until .Offset(tmp, 0).Value = "
.Offset(tmp, 0).Value = "hello
tmp = tmp +
Loo
End Wit
End Su
'----------------------------------------------------------------
However, if you have a table and in one of the columns you want to fill the cells with a value. And you want the macro to stop at the LAST ROW of the table, try the following macro
Select any cell in the column to fill, and run the macro
'----------------------------------------------------------------
Sub fill_to_bottom2(
Dim tmp As String, cell As Objec
Application.ScreenUpdating = Fals
With Selectio
tmp = Application.Intersect(Columns(.Column), .CurrentRegion).Addres
End Wit
With Range(tmp
For Each cell In .Cell
cell.Value = "hello
Nex
End Wit
End Su
'----------------------------------------------------------------
----- direwolf wrote: ----
I have an excel spreadsheet which I want to add two things to a macro
have
This first thing is I want to search a single column and delete an
rows that have 0 (zero) in it
The second thing I want to do is to fill a column with a word (th
column heading title) down to the last row. If the fill is done i
more or less completed rows then I get an error when I import the dat
into another application.
So I suppose I need code to look for data in say, the first column an
stop when it finds a blank