Small Macro Help

UpTheArgyle

Board Regular
Joined
Jan 12, 2006
Messages
179
Hi

I am trying to look at a block of cells to see if they are empty - if they are i want a value of "0" put in all the empty cells. So far i have this.....

Range("E8:K19").Select
If ActiveCell.Value = "" Then
ActiveCell.Value = "0"
End If

But all that does is place a "0" in cell E8

Any ideas?


Thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
You're only ever changing ActiveCell and that's always E8.

Maybe something along these lines:-
Code:
dim oCell as range
 
for each oCell in Range("E8:K19")
    If isempty(oCell) Then oCell = "0"
next oCell
 
Last edited:
Upvote 0
Awesome because it looks good or awesome because it works?
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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