Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Simple Command Button

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I've created a simple command button to goto a range of cells. The button works but I always get Run-time error 1004 Reference is not valid after it works.
    Please advise a beginner. Thanks

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    =ActiveCell.Address
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Not sure why it gives you the error. Is there any other info you can give? How are you defining the reference?

    I just threw a command button on a worksheet and added the following and I get no errors.
    (Note R1C1 notation of reference)

    Private Sub CommandButton1_Click()
    Application.Goto Reference:="R30C2:R30C6"
    End Sub

    Any help??

    Rgds
    AJ

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    =ActiveCell.Address
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Or, alternatively...

    Application.Goto Reference:=Range("A4:N304")

    You've gotta use the word "Reference", or else you'll get the runtime error

    Rgds
    AJ

  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    ok, thanks ill give that a try

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
  •