+ Reply to Thread
Results 1 to 7 of 7

Programming Excel with VBA: How to make Selection Nothing

  1. #1
    John Sherry
    Guest

    Programming Excel with VBA: How to make Selection Nothing

    Hi
    I'm programming Excel in VBA, after running a PasteSpecial method the pasted
    region is selected, I do not want any range selected. How can I turn off the
    selection?

    Anyone got any ideas on how to do this neatly?

    Many thanks in advance

  2. #2
    Tom Ogilvy
    Guest

    Re: Programming Excel with VBA: How to make Selection Nothing

    Range("A1").Select

    or

    Selection(1).Select

    --
    Regards,
    Tom Ogilvy


    "John Sherry" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    > I'm programming Excel in VBA, after running a PasteSpecial method the

    pasted
    > region is selected, I do not want any range selected. How can I turn off

    the
    > selection?
    >
    > Anyone got any ideas on how to do this neatly?
    >
    > Many thanks in advance




  3. #3
    Gary''s Student
    Guest

    RE: Programming Excel with VBA: How to make Selection Nothing

    close the file
    --
    Gary''s Student


    "John Sherry" wrote:

    > Hi
    > I'm programming Excel in VBA, after running a PasteSpecial method the pasted
    > region is selected, I do not want any range selected. How can I turn off the
    > selection?
    >
    > Anyone got any ideas on how to do this neatly?
    >
    > Many thanks in advance


  4. #4
    John Sherry
    Guest

    Re: Programming Excel with VBA: How to make Selection Nothing

    Thanks Tom,
    Range(A1").Select leaves "A1" selected.

    Selection(1).Select leaves top left cell of range selected.

    Tried Selection(0).Select, it leaves cell to left of top left cell of range
    selected.

    Am I asking too much of Excel to expect that there can be no cell selected?

    Best regards

    "Tom Ogilvy" wrote:

    > Range("A1").Select
    >
    > or
    >
    > Selection(1).Select
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "John Sherry" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi
    > > I'm programming Excel in VBA, after running a PasteSpecial method the

    > pasted
    > > region is selected, I do not want any range selected. How can I turn off

    > the
    > > selection?
    > >
    > > Anyone got any ideas on how to do this neatly?
    > >
    > > Many thanks in advance

    >
    >
    >


  5. #5
    Tom Ogilvy
    Guest

    Re: Programming Excel with VBA: How to make Selection Nothing

    There will always be something selected unless you protect the sheet and set
    enable selection to disallow selection. You can position the cursor off
    the screen

    ActiveWindow.VisibleRange.Offset(200,0).Activate

    perhaps.

    When you complained about pastespecial residue, I didn't realize your
    request was so primal.

    --
    Regards,
    Tom Ogilvy



    "John Sherry" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Tom,
    > Range(A1").Select leaves "A1" selected.
    >
    > Selection(1).Select leaves top left cell of range selected.
    >
    > Tried Selection(0).Select, it leaves cell to left of top left cell of

    range
    > selected.
    >
    > Am I asking too much of Excel to expect that there can be no cell

    selected?
    >
    > Best regards
    >
    > "Tom Ogilvy" wrote:
    >
    > > Range("A1").Select
    > >
    > > or
    > >
    > > Selection(1).Select
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "John Sherry" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi
    > > > I'm programming Excel in VBA, after running a PasteSpecial method the

    > > pasted
    > > > region is selected, I do not want any range selected. How can I turn

    off
    > > the
    > > > selection?
    > > >
    > > > Anyone got any ideas on how to do this neatly?
    > > >
    > > > Many thanks in advance

    > >
    > >
    > >




  6. #6
    Dana DeLouis
    Guest

    Re: Programming Excel with VBA: How to make Selection Nothing

    Perhaps a workaround...

    With ActiveSheet
    .EnableSelection = xlNoSelection
    .Protect
    End With

    HTH. :>)
    --
    Dana DeLouis
    Win XP & Office 2003


    "John Sherry" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    > I'm programming Excel in VBA, after running a PasteSpecial method the
    > pasted
    > region is selected, I do not want any range selected. How can I turn off
    > the
    > selection?
    >
    > Anyone got any ideas on how to do this neatly?
    >
    > Many thanks in advance




  7. #7
    Tushar Mehta
    Guest

    Re: Programming Excel with VBA: How to make Selection Nothing

    The only way that I know of not selecting anything is to deselect a
    chart. So, if you have a chart in the worksheet, the following in the
    VBE Immediate window yields 'Nothing'

    activesheet.chartobjects(1).activate
    activechart.Deselect
    ?typename(selection)

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <[email protected]>,
    [email protected] says...
    > Hi
    > I'm programming Excel in VBA, after running a PasteSpecial method the pasted
    > region is selected, I do not want any range selected. How can I turn off the
    > selection?
    >
    > Anyone got any ideas on how to do this neatly?
    >
    > Many thanks in advance
    >


+ 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