+ Reply to Thread
Results 1 to 4 of 4

VBA - button to move to another sheet to same cell

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-08-2008
    Posts
    121

    VBA - button to move to another sheet to same cell

    Hi, I'm trying to create a button on 2 sheets so when I click the button, it will move to that sheet with the same cell reference, i.e. cell A30 on sheet 1 will move to A30 on sheet 2 and vice versa. Any help would be much appreciated.

    Thanks
    Harry

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try

    Application.Goto Sheet1.Cells(30, 1)
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    Or try this if you want the button to select on the other sheet, the cell you have selected on the first sheet


    Sub changesheet()
    Dim newcell
    newcell = ActiveCell.Address
    If ActiveSheet.Name = "Sheet1" Then Sheets("Sheet2").Activate Else Sheets("Sheet1").Activate
    Range(newcell).Select
    End Sub
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Forum Contributor
    Join Date
    04-08-2008
    Posts
    121
    Thanks very much for your help - Works a treat!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1