+ Reply to Thread
Results 1 to 4 of 4

Range.Select

  1. #1

    Range.Select

    I understand that it is best practice to never use Range.Select in
    Excel VBA as it will often throw up bugs. I have found several examples
    for this from trawling the groups and it has happened to me several
    times when developing.

    However, i am at a loss trying to understand where the problem lies.
    Can anyone tell me what causes the bug?

    If you need a specific example i can try and create one.

    Many thanks

    Dan


  2. #2
    Registered User
    Join Date
    03-22-2006
    Posts
    25
    Hi Dan,

    I'm working with Excel for many years now and I have never heard of that problem / bug. In al my spreadsheest I use it, but never direct: I use names in stead.

    John.

  3. #3
    Dave Peterson
    Guest

    Re: Range.Select

    I've never considered it a bug in excel--but I do consider it a bug in the code.

    If you try to select a range that isn't on the activesheet, you'll get an
    error. So you'll want to make sure you activate the correct workbook, then
    select the correct sheet, then select the range (or use application.goto that
    does this all at once).

    Not a bug issue, but I've always found range.select followed by
    selection.somethingoranother much more difficult to understand/maintain.

    [email protected] wrote:
    >
    > I understand that it is best practice to never use Range.Select in
    > Excel VBA as it will often throw up bugs. I have found several examples
    > for this from trawling the groups and it has happened to me several
    > times when developing.
    >
    > However, i am at a loss trying to understand where the problem lies.
    > Can anyone tell me what causes the bug?
    >
    > If you need a specific example i can try and create one.
    >
    > Many thanks
    >
    > Dan


    --

    Dave Peterson

  4. #4
    DansGoode
    Guest

    Re: Range.Select

    Many thanks for that, i think it was the activesheet issue you refer
    to.


+ 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