Require a macro for Excel 2007

  • Thread starter Thread starter pcor
  • Start date Start date
P

pcor

I need a macro that will check out a given range( say a1 to z100)
As it checkd ther range(a1..z100) if there is NOT data in the cell, replace
the blank cell with $0.00
I appreciate all the help I am getting from this site
 
Hi

Try this:

Sub FillRange()
Dim TargetRange As Range
Set TargetRange = Range("A1:Z100")

For Each c In TargetRange
If c.Value = "" Then c.Value = Format("0", "$0.00")
Next
End Sub

Regards,
Per
 
Hi again,
Thanks for your reply.

Try this

Sub EmptyRange()
Dim TargetRange As Range
Set TargetRange = Range("A1:Z100")

For Each c In TargetRange
If c.Value = Format("0", "$0.00") Then c.Value = ""
Next
End Sub

Best regards,
Per
 
Back
Top