Results 1 to 2 of 2

Thread: Setforcus

  1. #1
    Join Date
    Sep 2005
    Posts
    313

    Unanswered: Setforcus

    Hi,

    In VB,

    How can I set forcus in the cells?

    Because I cannot find the setforcus function in VB.

    worksheets("sheet1").range("A10").setforcus

    Thanks.

  2. #2
    Join Date
    Feb 2004
    Posts
    533
    "SetFocus" is not a Method of Worksheet, Range, Cell objects. You want to use either the "Select" or "Activate" Method.
    SetFocus is only used with UserForm Objects.

    Range("A10").Activate

    Worksheets("Sheet1").Select
    Worksheets("Sheet1").Range("A10").Select

    Range("A10").Offset(0,3).Select

    Do you know you can put your cursor on the word "Range" in the VB Editor and press the F1 Key to open MS Help to list all the events and Methods?

    From Excel Help:
    To select a cell or a range of cells, use the Select method. To make a single cell the active cell, use the Activate method.

    Example
    This example selects cells A1:B3 on Sheet1.

    Worksheets("Sheet1").Activate
    Range("A1:B3").Select
    ~

    Bill

Posting Permissions

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