+ Reply to Thread
Results 1 to 5 of 5

Unknown code

  1. #1
    Registered User
    Join Date
    04-30-2006
    Posts
    55

    Unknown code

    I'm trying to copy a macro to a new sheet, but ik keeps getting stuck at this line. What does this do:

    Please Login or Register  to view this content.
    Thanks,

    Peter1999

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    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

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    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...

  4. #4
    Registered User
    Join Date
    04-30-2006
    Posts
    55
    Thanks for your explanation! Appreciate it.

    Peter1999

  5. #5
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Pleased we could help, thanks for the feedback :-)

    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1