Hi,
I have a range of cells named , for example as "test_data". How can I achieve the following:
If the cell is blank then write '0'
else do nothing if the cell has some characters.
Thanks
Hi,
I have a range of cells named , for example as "test_data". How can I achieve the following:
If the cell is blank then write '0'
else do nothing if the cell has some characters.
Thanks
Maybe
VBA Noob=IF(A1="",0,"Do something else here")
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Select the range
Do Edit > Goto > Special > Blanks
Type 0, Ctrl+Enter
Great!!! Thanks it worked like a charm....You are awesome. Now the only thing that remains is to somehow write a formula or a VBA code for this.Originally Posted by shg
VBA NoobPlease Login or Register to view this content.
Please Login or Register to view this content.
Hello modest_16081982,
Just an addendum to Shg's andVBA Noob's last post. When using the SpecialCells method, it will generate an error if no blank cells are found in the given range. If you don't trap the error, your macro will be interrupted. Here's an example of trapping the error if it occurs, and then restoring normal error handling.
Sincerely,Please Login or Register to view this content.
Leith Ross
Great!!! Thank all of you three guys for helping me out.Originally Posted by Leith Ross
You guys rock.
Thanks Leith as usual,
modest_16081982,
Good to see you got a solution
VBA Noob
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks