Changing Blank cells in a range to values?

scott-atkinson

I'm with the Witch.......
Local time
Today, 17:24
Joined
Aug 31, 2006
Messages
1,618
Could somebody help me with a codeing in VBA for a specific task.

I have a range of cells, some of which have values, some of which have no values, I wish to change the cells with no values to have the value of "0.00".

Does anyone know the correct coding to achieve this?


I have tried If Then statments but I have over 200 cells to check and did not want to right 200 IFTHEN statements!

Thanks
 
Try:

Code:
Sub bleh()

Dim rng As Range

For Each rng In Range("A1:J20")
    If rng.Value = "" Then
        rng.Value = "0.00"
    End If
Next rng


End Sub

Just change the bit that says "Range("A1:J20")" with however you determine the appropriate range.

might be better to post this stuff in the excel forum.
 

Users who are viewing this thread

Back
Top Bottom