replace non empty cells of text with zero

excel01noob

Board Regular
Joined
Aug 5, 2019
Messages
93
Office Version
  1. 365
  2. 2016
Hi

I have an excel file report that I need to check daily.
In that file I have some columns with numbers but some cells do not show any number. They should show zero, but when doing ISBLANK they should as FALSE (not blank then)

I want to create a Macro that:

-checks within the columns E8 and F8 (it is always the first cell with numbers) and until the end of the data in those columns (which varies each day);
-all the cells that are NOT NUMBER but also NOT BLANK and;
-replace the content with the number zero.


I'm sure this is feasible but personally tried record macros and could not get the proper result.
any idea how it should be?

thank you in advance
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Without being able to see the file, we can only guess at a solution. Here is my guess...
Code:
Sub ReplaceBlanksWithZeros
  Range("E8", Cells(Rows.Count, "E").End(xlUp)).SpecialCells(xlConstants, xlTextValues).Value = 0
  Range("F8", Cells(Rows.Count, "F").End(xlUp)).SpecialCells(xlConstants, xlTextValues).Value = 0
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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