Hi everyone,
I have the below code in a spreadsheet five times changing only the range...I can't figure out the syntax to make this a "Select Case" type statement. I'm still a novice VBA'er...could anyone please provide me some guidance into how i need to structure this so i can clean the code up a bit?
I colored the only piece that changes in red...I searched the internet for an hour and couldn't figure out exactly how to change this up to make it a bit simpler/cleaner looking.
Any guidance or push in the right direction is appreciated!!! THANKS!
-belang46
I have the below code in a spreadsheet five times changing only the range...I can't figure out the syntax to make this a "Select Case" type statement. I'm still a novice VBA'er...could anyone please provide me some guidance into how i need to structure this so i can clean the code up a bit?
I colored the only piece that changes in red...I searched the internet for an hour and couldn't figure out exactly how to change this up to make it a bit simpler/cleaner looking.
Any guidance or push in the right direction is appreciated!!! THANKS!
-belang46
Code:
For Each cel In Sheets(strOrderSheet).Range([COLOR=red]strUnitsRange[/COLOR]).Cells
If cel.Value = 0 Then cel.EntireRow.Hidden = True
If cel.Value <> 0 Then cel.EntireRow.Hidden = False
Next cel