I'm trying to copy a macro to a new sheet, but ik keeps getting stuck at this line. What does this do:
Thanks,![]()
Please Login or Register to view this content.
Peter1999
I'm trying to copy a macro to a new sheet, but ik keeps getting stuck at this line. What does this do:
Thanks,![]()
Please Login or Register to view this content.
Peter1999
It sets a range - rngSheetInfo to be the currentregion of A1 on a sheet called whatever the variable c_strSheetListing is
![]()
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
hi Peter,
If you select the word "Set" in the VB Editor & [F1] the Help file will tell you that this "Assigns an object reference to a variable or property.".
In plain English for your situation...
The line of code is trying to "set" the variable "rngSheetInfo" (hopefully it's dimmed as a range variable) to be the current region (ie occupied cells) around cell A1 ("cells(1,1)") in the file that the macro is in, on the worksheet called xyz where xyz is the string that should have been defined earlier in the macro as "c_strSheetListing = xyz".
I suggest checking your sheet names because the error is probably due to the lack of a sheet called xyz in the macro workbook.
Two ways of seeing what "c_strSheetListing" is defined (while the macro has stopped on this line) as, are:
* holding your mouse over it in the VB Editor.
*In the VB Editor pressing [ctrl + G], typing "?c_strSheetListing" (without the quotation marks) & pressing [Enter].
hth
Rob
Rob Brockett
Kiwi in the UK
Always learning & the best way to learn is to experience...
Thanks for your explanation! Appreciate it.
Peter1999
Pleased we could help, thanks for the feedback :-)
Rob
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks