Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default formula to blank cells

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default formula to blank cells

Your If..Then test should be this...

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

--
Rick (MVP - Excel)


"joemeshuggah" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default formula to blank cells

Thank you!!!!

"Rick Rothstein" wrote:

Your If..Then test should be this...

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

--
Rick (MVP - Excel)


"joemeshuggah" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Array Formula for Counting Blank & Non Blank Cells (Multiple Criteria) foofoo Excel Discussion (Misc queries) 3 February 20th 12 08:03 PM
Need Formula - If blank cells hilltop55 Excel Discussion (Misc queries) 3 September 17th 09 02:20 PM
Formula to sum blank cells rldjda Excel Worksheet Functions 2 March 23rd 08 06:29 AM
Formula Help: Add cells with certain text + cells that are blank Nicole L. Excel Worksheet Functions 3 February 27th 07 06:59 AM
How do i keep cells blank until the formula is used? Ellen Excel Discussion (Misc queries) 4 February 3rd 06 12:44 PM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"