+ Reply to Thread
Results 1 to 3 of 3

Set range still shows nothing

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2003
    Posts
    8

    Question Set range still shows nothing

    Hi All,

    I have the following code:

    Please Login or Register  to view this content.
    Here is my debug:

    Sheet1
    sheet1.therowstart: 3
    colindex: 17
    rowcount: 3
    value:
    3
    17
    My issue is that somehow, even though I'm telling Excel to go to cells(3,17) on the active sheet (wsheet), it's not seeing a value (or much less anything else). Consequently, I am unable to identify a range.

    I can't even add cells(1,1).select to my code without getting a 1004 error.

    Does anyone have any idea what might be causing this and how I can go about fixing it?

    Thanks.

    Regards,

    William

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,003

    Re: Set range still shows nothing

    If your code is located in a worksheet code module rather than a normal module, then any reference to Cells or Range that is not explicitly qualified with a worksheet object will refer to the sheet containing the code. (Since that is not the active sheet, you cannot select a cell that way.) You need to use:
    Please Login or Register  to view this content.
    for example (or a With...End With block for neatness)
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    08-12-2009
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2003
    Posts
    8

    Talking Re: Set range still shows nothing

    Perfect.

    Thank you.

    Regards,

    William

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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