Hi everyone,
I am a relatively new user of Excel/VBA.
In the past days I ave been working in making as automatic as possible a macro, using a lot of help that I found online.
However, I am now trying to do something which in my head (read: from previous experience with other programming languages) should be possible, but I cannot make it work.
The working code is the following:
NB: localFile, dataSheet, dataRow, scNameCol etc...have been declared previously of the appropriate type and set at the correct values. The code, indeed, works.![]()
Please Login or Register to view this content.
Since I want to make it more re-usable, I want to change the first line with a generic range (let's call it scRange) which will be defined in the code. So, I modified the codee like this:
This piece of code does not work. I am probably biased from my C++ bakground, since I do not understand why it shouldn't work.![]()
Please Login or Register to view this content.
If someone could explain what is wrong and how to solve it I would be grateful!
ADDITIONAL:
the final goal is that scRange should be defined differently based on the content of a cell in a sheet. Something like (I know this is not VBA, but I am just trying to send the message)
An answer to the first part would be already good, if you happen to know the answer to the second part also, even better![]()
Please Login or Register to view this content.
thanks a lot in advance!
Konx
Bookmarks