Hello, everyone,
I have an interesting problem. I wrote a macro a few weeks ago and it appeared to work fine for all the users who need to run it. But yesterday, the primary user ran it and the macro failed because one of the variables took on an incorrect value during execution. The error message is Run-Time Error '5': Invalid Procedure Call or Argument.
The macro captures the last column in the header row and strips away the absolute reference dollar sign and the cell number ("1" in this case) and leaves only the column letter behind. Later in the procedure this column letter is used to set a range to a variable.
The problem is this: When I run the macro, the column letter comes in as a single alpha character. When the user having the issue runs the macro, the variable is populated with a RANGE REFERENCE instead. So mine comes in as "C". Hers comes in as "C:C". The macro still removes the cell number from the reference and the "$" from the absolute references, but the initial value from her machine is "$C1:$C1" instead of just "$C1" (it may actually be "$C$1:$C$1"; if that matters I'll find out for certain and update the post).
So my question is, what would cause one machine (I tested with another, and with mine, and of the three only the one behaves this way) to assign the value of that variable that way? Is there a setting somewhere which can be adjusted to correct this? Also, just to be thorough, I tried to build an IF...THEN statement to accommodate the range value, but it still failed for this particular user. And I have NO idea what's going on.
Any and all help much appreciated.
Warm regards and have a great day.
Bookmarks