ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Require a macro for Excel 2007 (https://www.excelbanter.com/new-users-excel/187298-require-macro-excel-2007-a.html)

pcor

Require a macro for Excel 2007
 
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


Per Jessen

Require a macro for Excel 2007
 
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
"pcor" skrev i meddelelsen
...
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



pcor

Require a macro for Excel 2007
 
Just great. An now if I may.
How do I replace at these $0.00 with a blank
Thanks very much

"pcor" wrote:

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


Per Jessen

Require a macro for Excel 2007
 
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

"pcor" skrev i meddelelsen
...
Just great. An now if I may.
How do I replace at these $0.00 with a blank
Thanks very much

"pcor" wrote:

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



pcor

Require a macro for Excel 2007
 
Thanks for the quick reply...BUT that last one did not work. Any other ideas
Thanks

"Per Jessen" wrote:

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

"pcor" skrev i meddelelsen
...
Just great. An now if I may.
How do I replace at these $0.00 with a blank
Thanks very much

"pcor" wrote:

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





All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com