DutchKevin
Board Regular
- Joined
- Apr 13, 2011
- Messages
- 133
- Office Version
- 365
- Platform
- Windows
Hello,
For my code I face a problem that should hopefully be solvable in a better way than what i now have.
Suppose I have a list of approx 12 column names (Drinks, Transport, Country etc) . Let's assume the word Name is the unique identifier here.
From that list I need to Dim the following variables
NameCol as Integer
NameRange as Range
NameMessage as String
NameCounter as Long
NameErrorCounter as Long
This example alone has 5 x 12 = 60 Dim's
My actual code is a bit more elaborate than this example. It quickly becomes quite big.
Is there a way I can loop through my list of names and that a subcode does 5 x Dim with each name?
And if a new Name is added to my list the whole code would simply accept it and do what is intended.
Does it declare my required variables? Can I then use these variables?
e.g. DrinksCol, DrinksRange, DrinksMessage, DrinksCounter, DrinksErrorCounter, TransportCol, TransportRange, TransportMessage etc etc
Thanks for thinking with me in this one
For my code I face a problem that should hopefully be solvable in a better way than what i now have.
Suppose I have a list of approx 12 column names (Drinks, Transport, Country etc) . Let's assume the word Name is the unique identifier here.
From that list I need to Dim the following variables
NameCol as Integer
NameRange as Range
NameMessage as String
NameCounter as Long
NameErrorCounter as Long
This example alone has 5 x 12 = 60 Dim's
My actual code is a bit more elaborate than this example. It quickly becomes quite big.
Is there a way I can loop through my list of names and that a subcode does 5 x Dim with each name?
And if a new Name is added to my list the whole code would simply accept it and do what is intended.
Does it declare my required variables? Can I then use these variables?
e.g. DrinksCol, DrinksRange, DrinksMessage, DrinksCounter, DrinksErrorCounter, TransportCol, TransportRange, TransportMessage etc etc
Thanks for thinking with me in this one