+ Reply to Thread
Results 1 to 5 of 5

Goto Sheet named in linkedcell

Hybrid View

  1. #1
    Registered User
    Join Date
    10-30-2009
    Location
    UK
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    60

    Goto Sheet named in linkedcell

    I have a combobox attached to a userform which I'm using to populate the value of cell A1 on a worksheet named "data".

    Could someone help me out with the VBA for activating the worksheet named in this Data!A1 cell please?
    Last edited by Janc; 02-26-2015 at 03:54 PM. Reason: Solved. Thank you.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Goto Sheet named in linkedcell

    Try this sample workbook
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Goto Sheet named in linkedcell

    Maybe?

    Sub Janc()
    Sheets(Sheets("Data").Range("A1").Value).Activate
    End Sub

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Goto Sheet named in linkedcell

    Simple and effective .. Great line of code

  5. #5
    Registered User
    Join Date
    10-30-2009
    Location
    UK
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    60

    Re: Goto Sheet named in linkedcell

    Thanks both very much - I needed a combination of both of your replies to fully solve my issue, so you helped further than I was anticipating

    When an option is chosen from my combobox, the cell on Data!A1 updates with the value form the combobox with this code:

    Private Sub OKButton_Click()
    
    Sheets(Sheets("Data").Range("A1").Value).Activate
    
    End Sub

    But I had omitted this very important part for when the list within the combobox is changed:

    Private Sub cboName_Change()
    
    Dim strValue As String
        strValue = cboName.Value
        Worksheets("Data").Range("A1") = strValue
    End Sub

    I'm posting this code for my own future reference as well as to help others.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Goto a named cell using Worksheet_BeforeDoubleClick(
    By Daniel Brown in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2015, 10:04 AM
  2. Goto a named range/cell
    By darbid in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-27-2008, 06:07 AM
  3. [SOLVED] Shape ControlFormat.LinkedCell returns wrong Address for named range - BUG
    By bowlegtroy@hotmail.com in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-14-2006, 10:10 AM
  4. Goto first or last sheet
    By Jac Tremblay in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2006, 10:50 PM
  5. [SOLVED] Goto a named range using the contents of the active cell
    By Brian C in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2006, 12:14 AM

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