I hope you can help me with a crazy idea. I am not sure if this is possible and I don't even know how to call this.
I would like to use a variable building its name on the fly.
Is this possible?
I am reading an html file line by line and my code needs to know in what sheet to store current line. I have around 10 sheets but for the question, I will use only two sheets: Module and Switch. For every sheet I have a "WhateverSheetRow" variable to keep record of the updated row. In this example: ModuleRow and SwitchRow. My thought is that, because I am writing in each Row of each Sheet, I know which Row is the last one updated, so in the next occurrence, I will increase it by 1 and update it instead of using find or any other "last empty Row" updated method. Is there a way to increase WhateverSheetRow by 1 building the variable name on the fly?
Dim ModuleRow as Long
Dim SwitchRow as Long
Dim Found as String
If Found = "Module" Then 'String found is Module
Found & "Row" = Found & "Row" + 1 'Increase ModuleRow by one
Sheets(Found).Range("A" & (ModuleRow)).Value = "Y"
So the question is if there is a way to "build" the variable name and use it.
Or what would be a better option?
Thanks a lot!