Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cursor Focus (Excel 2000)

    Is it possable to move the focus of the cursor a cell in the first page when I execute a macro?

    Thanks

  2. #2
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cursor Focus (Excel 2000)

    Shimmer,

    Are you referring to the active cell (the cell that is outlined)? This can be done within the macro. Where did you want it moved to?
    Are you referring to the active cell on the active worksheet or a different worksheet?
    Would it be possible to explain in more detail what you are tryiing to accomplish?

    Chuck
    Chuck Reimer
    I'm from the Government and I'm here to help...

  3. #3
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cursor Focus (Excel 2000)

    I just have a macro which just traverses though a excel workbook which acts as a form. My code starts off by referencing objects in the first worksheet. What I want it to just move thw cursor and focus to the first worksheet before any other code execute when the user clicks the macro, otherwise I will get an error with an out of range. I am referring to the active cell on the workshhet

  4. #4
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cursor Focus (Excel 2000)

    Shimmer,
    To make sure the focus is on a certain worksheet, use the follow code in your macro:
    Sheets("Sheet1").Select - You may have to change the sheet name to match what you have.
    Or have I missed the point? ((it happens))

    Chuck
    Chuck Reimer
    I'm from the Government and I'm here to help...

  5. #5
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cursor Focus (Excel 2000)

    No that was it. [img]/forums/images/smilies/smile.gif[/img] I just could not get the focus to start at a certain points

    Thanks

  6. #6
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,815
    Thanks
    132
    Thanked 479 Times in 456 Posts

    Re: Cursor Focus (Excel 2000)

    Assuming your code has put you the correct worksheet, you can use
    [a1].Select 'to put cellpointer in cell A1

    It is also sometimes useful to make sure that column A and row 1 is visible even if the active cell is [a1].
    For example, you may have scrolled many columns down or across.

    To do this you use
    ActiveWindow.ScrollRow = 1
    ActiveWindow.ScrollColumn = 1
    [a1].Select

    zeddy

Posting Permissions

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