ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Zeros in blanks (https://www.excelbanter.com/excel-programming/422737-zeros-blanks.html)

MikeF[_2_]

Zeros in blanks
 
I have zeros for blanks turned off as an Excel option.
But in some ranges on some sheets, need a "if cell value = "" then make it
zero" routine.

Best suggestions??

Thanx,
- Mike

Gary''s Student

Zeros in blanks
 
Select a range and then:

Sub noBlank()
For Each r In Selection
If r.Value = "" Then
r.Value = 0
End If
Next
End Sub

--
Gary''s Student - gsnu200828


"MikeF" wrote:

I have zeros for blanks turned off as an Excel option.
But in some ranges on some sheets, need a "if cell value = "" then make it
zero" routine.

Best suggestions??

Thanx,
- Mike



All times are GMT +1. The time now is 03:44 AM.

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