Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Active Cell

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Dave Hawley - You may recall you helped me with this:
    Hi Nigel

    assumming you know how to select a cell with VBA place this in the Private Module of the Sheet concerned. Right click on the sheet name tab and select "View Code"

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$1" Then
    Application.MoveAfterReturn = Not IsEmpty(Target.Value)
    End If
    End Sub

    As you can see it assumes your cell is A1

    Trouble I do not know how to select a cell in VBA (fairly new to this VBA game - still learning).

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Nigel


    To select a cell in VBA you would use:

    Range("A1").select
    or
    Cell(1,1).Select

    These are for the activesheet only. If on another sheet the easiest way is:

    Application.Goto Sheets("Sheet1").Range("A1"), True

    The True after the GoTo reference will place the selected cell in the top left of your screen.




  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Dave, I will have a play with it.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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