Johnny Thunder
Well-known Member
- Joined
- Apr 9, 2010
- Messages
- 693
- Office Version
- 2016
- Platform
- MacOS
Hello All,
I have a small script that takes values from one sheet and populates other tabs based on specific criteria.
I have a small declaration of variables that I am trying to validate that there are values within the variables, if not I want to change the variables to "N/A" as the output. Not sure how to write a script like thought without repeating a IF/Then statement for each of my variables.
List of Variables (Small Sample List):
ProjectName = .Cells(r, 1).Value
ProjectDesc = .Cells(r, 2).Value
Status = .Cells(r, 3).Value
Time = .Cells(r, 4).Value
This is how I did it but there has to be a better way -
And I just repeated this 10 times for all the other variables. Any help is appreciated.
I have a small script that takes values from one sheet and populates other tabs based on specific criteria.
I have a small declaration of variables that I am trying to validate that there are values within the variables, if not I want to change the variables to "N/A" as the output. Not sure how to write a script like thought without repeating a IF/Then statement for each of my variables.
List of Variables (Small Sample List):
ProjectName = .Cells(r, 1).Value
ProjectDesc = .Cells(r, 2).Value
Status = .Cells(r, 3).Value
Time = .Cells(r, 4).Value
This is how I did it but there has to be a better way -
VBA Code:
if ProjectName = vbnullstring then Projectname = "N/A"
And I just repeated this 10 times for all the other variables. Any help is appreciated.