formula to blank cells

J

joemeshuggah

looking to create a macro that loops through rows and fills all blank cells
in a column with a formula that shows the value in the cell just above.

for example, i want row 3 to read bottom and rows 6 & 7 to read right.

row col A
1 top
2 bottom
3
4 left
5 right
6
7
8 up


i thought something like the below would work, but get an "object required"
error message

FinalRowMAINROW = Cells(Cells.Rows.Count, "B").End(xlUp).Row

For i = 2 To FinalRowMAINROW
If Cells(i, 1).Value Is Null Then
Cells(i, 1).FormulaR1C1 = "=R[-1]C"
End If
Next i
 
J

joemeshuggah

Thank you!!!!

Rick Rothstein said:
Your If..Then test should be this...

If Cells(i, 1).Value = "" Then

--
Rick (MVP - Excel)


joemeshuggah said:
looking to create a macro that loops through rows and fills all blank
cells
in a column with a formula that shows the value in the cell just above.

for example, i want row 3 to read bottom and rows 6 & 7 to read right.

row col A
1 top
2 bottom
3
4 left
5 right
6
7
8 up


i thought something like the below would work, but get an "object
required"
error message

FinalRowMAINROW = Cells(Cells.Rows.Count, "B").End(xlUp).Row

For i = 2 To FinalRowMAINROW
If Cells(i, 1).Value Is Null Then
Cells(i, 1).FormulaR1C1 = "=R[-1]C"
End If
Next i
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top