newatmacros
New Member
- Joined
- Jun 23, 2016
- Messages
- 18
Hi Everyone,
As you can tell by my username, I am very new to Excel VBA. I just started really utilizing it when I first realized that I can record a macro; however, as I continued it, realized what a powerful tool it can be for my work place when utilizing various data sheets. So far, many of the blogs posted and the reviews attached to them have been very helpful and have helped me create some great macros that do exactly what I want them to do; however, there is one command that is stumping me.
I need a macro do the following:
Search for certain cells with multiple criteria options. (ie. Beverages, Produce, Cold Food)
Select those cells.
Then, select entire columns of the selected cells.
Then, select Blank cells in the columns selected.
Lastly, enter "0" for all of the blank cells in those columns only.
It is very important that the code can search through the entire worksheet (A:ZZ) for these cells with this criteria as I do not want it dependent that the criteria cells will be in the same locations. Also, it is important that only those blank cells from the specified columns are filled with "0". If any other cells are filled with zero, the entire computations that come after will be skewed.
I have tried constant macros and "If Else Then" macros but I have never gotten any of them to fully work for what I need. If anyone knows how to do this with an "If Else Then" macro, it can be very helpful for other macros I may need to create so I can know what I may doing wrong.
Help?
Thank everyone!
As you can tell by my username, I am very new to Excel VBA. I just started really utilizing it when I first realized that I can record a macro; however, as I continued it, realized what a powerful tool it can be for my work place when utilizing various data sheets. So far, many of the blogs posted and the reviews attached to them have been very helpful and have helped me create some great macros that do exactly what I want them to do; however, there is one command that is stumping me.
I need a macro do the following:
Search for certain cells with multiple criteria options. (ie. Beverages, Produce, Cold Food)
Select those cells.
Then, select entire columns of the selected cells.
Then, select Blank cells in the columns selected.
Lastly, enter "0" for all of the blank cells in those columns only.
It is very important that the code can search through the entire worksheet (A:ZZ) for these cells with this criteria as I do not want it dependent that the criteria cells will be in the same locations. Also, it is important that only those blank cells from the specified columns are filled with "0". If any other cells are filled with zero, the entire computations that come after will be skewed.
I have tried constant macros and "If Else Then" macros but I have never gotten any of them to fully work for what I need. If anyone knows how to do this with an "If Else Then" macro, it can be very helpful for other macros I may need to create so I can know what I may doing wrong.
Help?
Thank everyone!