+ Reply to Thread
Results 1 to 3 of 3

Finding spreedsheets by name of it macro

Hybrid View

Szwadron Finding spreedsheets by name... 07-21-2015, 04:40 AM
skywriter Re: Finding spreedsheets by... 07-21-2015, 04:55 AM
bakerman2 Re: Finding spreedsheets by... 07-21-2015, 06:22 AM
  1. #1
    Registered User
    Join Date
    02-02-2014
    Location
    Poznań, Poland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Finding spreedsheets by name of it macro

    Hello,

    In attachment there is an empty file. I need to make two macros.

    1) When I enter the file a widnow appear when I can write name of the spreedshit to go to. – already done that.
    2) But I would also like to create another macro which I have no idea how to do. It would go for when I enter to this window name of the person I would like all the remaining spreesheets disappear.
    Names are hidden as the initials as the last two digitis in the name of spreedsheet.

    ES – Ewelina
    MK – Maciej
    AO – Ania O
    DM – Dawid
    RG – Renata
    ET - Erkyk
    AOL – Adam
    MZ - Monika
    AK – Ania K
    AT – Amin
    FM – Filip

    Could you please help me with this? I cannot even come to think how to start writing this.

    Thank you very much in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Finding spreedsheets by name of it macro

    Maybe something like this.

    You would just enter the initials, for instance AK and only that sheet will be visible.

    Sub HideSheets()
    Dim strInitials As String, s As Worksheet
    
    strInitials = InputBox("Enter Initials", "Enter Initials")
    
    For Each s In Worksheets
        If Not s.Name Like "*" & strInitials Then
            s.Visible = xlHidden
        Else
            s.Visible = xlSheetVisible
        End If
    Next s
    
    End Sub

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,362

    Re: Finding spreedsheets by name of it macro

    You do not need an extra button on your Userform.
    Userform code
    Private Sub UserForm_Initialize()
        For i = 1 To Sheets.Count
            sn = sn & "|" & Sheets(i).Name
        Next
        ComboBox1.List = Split(Mid(sn, 2), "|")
    End Sub
    
    Private Sub ComboBox1_Change()
        Dim s As Worksheet
        On Error Resume Next
        For Each s In Worksheets
            s.Visible = IIf(s.Name = ComboBox1.Value, -1, 0)
        Next s
    
        UserForm1.Hide
    End Sub
    Thisworkbook code
    Private Sub Workbook_Open()
        UserForm1.Show
    End Sub

+ 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. Merging two spreedsheets containing address into one
    By ovettmufc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2013, 07:57 AM
  2. Make Relation Between two spreedsheets
    By bobo_21002100 in forum Excel General
    Replies: 0
    Last Post: 06-18-2010, 01:32 PM
  3. Link 2 SpreedSheets
    By Khaled197 in forum Excel General
    Replies: 1
    Last Post: 03-03-2007, 09:57 AM
  4. [SOLVED] How do i add multi-spreedsheets together
    By Ashley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2006, 04:10 PM
  5. Replies: 0
    Last Post: 08-29-2005, 05:05 PM
  6. DIFFERNCE BETWEEN EXCELL AND WORKS SPREEDSHEETS
    By THE JOKER in forum Excel General
    Replies: 0
    Last Post: 08-29-2005, 05:05 PM
  7. [SOLVED] Excel spreedsheets that are linked to other documents. #REF!
    By mmollat in forum Excel General
    Replies: 3
    Last Post: 02-15-2005, 08:13 PM
  8. Replies: 0
    Last Post: 02-15-2005, 05:49 PM

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