+ Reply to Thread
Results 1 to 3 of 3

Error while selecting a range

  1. #1
    Registered User
    Join Date
    04-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    44

    Unhappy Error while selecting a range

    I am using the following statement to return to first sheet after completing a 'For Next' loop. This throws an error.

    Please Login or Register  to view this content.
    This works when I modify this to -
    Please Login or Register  to view this content.
    I have reinstalled Excel and rebooted several times but still this happens. What's wrong and what should I do? Thanks!

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Error while selecting a range

    Nothing is wrong. You cannot select a range on a sheet that is not active, so you have to activate that sheet first.
    You could almost certainly rewrite your For...Next loop so that it doesn't change the active sheet when it runs though.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    04-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Error while selecting a range

    Thanks romperstomper.
    This looks bit strange not to be able to directly select a range. This may be Excel's fault. Many thanks to you!

+ 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