+ Reply to Thread
Results 1 to 4 of 4

Hidden Sheet - Hyperlink and Copy

Hybrid View

  1. #1
    Registered User
    Join Date
    09-16-2018
    Location
    Washington State, USA
    MS-Off Ver
    2016
    Posts
    43

    Hidden Sheet - Hyperlink and Copy

    i have some code wrote to copy a Hidden Sheet; Rename it based on a cell and hyperlink that cell to the sheet. I'd like to add a couple things to the code but struggling to figure it out. Below is the full sequence I would like it to do. (step 4 is what I need help with)

    1. Copy Hidden Sheet
    2. Rename the sheet to the active cell I'm in
    3. Hyperlink the active cell to the sheet
    4. Hide the new sheet
    5. Keep the hyperlink functional

    Note: I also have a button on the sheet that is linked to the main page of my workbook - how can I add function to hide the sheet when I go back to that page?


    Sub add_new_sheet()
    CarryOn = MsgBox("ARE YOU IN THE PROJECT NAME CELL?", vbYesNo, "CREATE NEW PROJECT?")
    
    If CarryOn = vbYes Then
    Dim sheet_name_to_create As String
    Dim sh As Worksheet, nsh As Worksheet 'nsh = sheet_name_to_create
    Dim nrng As Range
    Dim cont As Worksheet
    Dim oRng As Range
    
    sheet_name_to_create = ActiveCell.Value
        Set oRng = ActiveCell
       Set sh = Sheets("PRODUCTION SCHEDULE")
       
       
     For rep = 1 To (Worksheets.Count)
     If UCase(Sheets(rep).Name) = UCase(sheet_name_to_create) Then
     
     MsgBox "ALREADY EXISTS - CHECK YOUR PROJECTS"
     Exit Sub
     End If
     
     
     Next
     
     Sheets("MASTER PT SHEET").Visible = True
     Sheets("MASTER PT SHEET").Copy after:=Sheets(Sheets.Count)
     
     ActiveWindow.ActiveSheet.Name = sheet_name_to_create
     Sheets("MASTER PT SHEET").Visible = False
     
     sh.Activate
     sh.Hyperlinks.Add oRng, "", "'" & sheet_name_to_create & "'!A1", _
     "Go to " & sheet_name_to_create, sheet_name_to_create
     
     Set oRng = Nothing
    
    End If
    
    End Sub

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,770

    Re: Hidden Sheet - Hyperlink and Copy

    Would this not work?
    Worksheets(sheet_name_to_create).Visible = False

  3. #3
    Registered User
    Join Date
    09-16-2018
    Location
    Washington State, USA
    MS-Off Ver
    2016
    Posts
    43

    Re: Hidden Sheet - Hyperlink and Copy

    That does work for making hidden. What about making the hyperlink still work? Once its hidden the hyperlink doesnt work

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,770

    Re: Hidden Sheet - Hyperlink and Copy

    Have a look here. A way better job of explaining than I ever could do.

    https://stackoverflow.com/questions/...heet-excel-vba

+ 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. Hyperlink to hidden sheet using a cell with the =Hyperlink formula
    By pauldonnelly16 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2018, 07:53 PM
  2. Hyperlink to a hidden sheet
    By Keibri in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2015, 09:47 AM
  3. [SOLVED] hyperlink in hidden sheet
    By edwinculanding in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-08-2013, 11:12 AM
  4. Replies: 2
    Last Post: 01-13-2012, 04:59 PM
  5. Hyperlink with Hidden Sheet
    By niladri20005 in forum Excel General
    Replies: 0
    Last Post: 10-21-2011, 01:10 PM
  6. hyperlink to a hidden sheet
    By globalpontoon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2011, 01:11 PM
  7. How do I Hyperlink to a hidden sheet in a same workbook ?
    By aman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2005, 09:06 AM

Tags for this Thread

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