Loop Through Blank Cells and Populate with Value Above

marka87uk

Board Regular
Joined
Mar 24, 2007
Messages
247
Hi,

I need to loop through the selected range (e.g. A8:E10000) and if a cell is blank then it's formula needs to equal the cell above it (i.e. if A10 is blank then it's formula should be =A9).

Please can you point me in the right direction?

Many thanks. :)
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Highlight the range A8:A10000
Press CTRL + G
Click Special
Select Blanks
Click OK
Press =
Press UP Arrow
Press CTRL + ENTER


If this must be done in a macro, use the macro recorder to record yourself doing the above steps.

Hope that helps.
 
Upvote 0
Hi,

Is there a specific need for a macro ?

F5 Special Blanks
equal above cell
control enter

HTH



P.S. oops ... JohnMo1 went a lot faster ... :)
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top