Consulting

Results 1 to 3 of 3

Thread: Solved: Code Select Sheet & Range single step

  1. #1
    VBAX Regular
    Joined
    Dec 2008
    Posts
    85
    Location

    Solved: Code Select Sheet & Range single step

    Hi all:

    I usually used:

    Sheets("name").select
    Range("name).select

    Now I am trying to do it in a single step:

    Sheets("name").range("name").select

    But I still missing something to make it work.

    Please let me know how to solve it.

    Thanks for the help.

    Victor

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    [vba]Application.Goto Worksheets("Sheet3").Range("A1:B20"), True[/vba]

    Hope this helps,

    Mark

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Victor,
    Unless the Selection is the "end result", you should try to avoid selecting cells in macro code. Ranges can be manipulated without selection
    eg
    [VBA]Worksheets("Sheet3").Range("A1:B20").Interior.ColorIndex = 6
    'or
    Worksheets("Sheet3").Range("A1:B20").Copy Worksheets("Sheet1").Range("A1")[/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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