+ Reply to Thread
Results 1 to 7 of 7

Copy Find All Dialogue Box

Hybrid View

  1. #1
    Registered User
    Join Date
    10-22-2015
    Location
    Oneonta, ny
    MS-Off Ver
    2010
    Posts
    30

    Copy Find All Dialogue Box

    About a week ago I found the solution to my goal (weeks of on and off searching) from this forum site however, the VBA code didn't work on my computer. I intend to post it here later since I don't have access to it now and can't find it. For now though, here is my question:

    I need to "find all" of a specific word and produce a copy of that "find all" list. More specifically, I want a list of the cell names (Sheet1!A1, Sheet2!B52, Sheet3!C20, for example) where my search criteria is located. So if I'm looking for the word "Pizza" and it's found in those cells, I want to copy that whole list for multiple worksheets (each worksheet ranging from A1 through Z3000; gaining rows as the file is updated).

    I have extremely limited VBA experience and am now reading books to understand it more. When I post the code, I'd also like to know how to fix it too.

    Thx in advance.

    MsBBStacker
    Last edited by MsBBStacker; 10-31-2015 at 08:12 AM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Copy Find All Dialogue Box

    Hi

    This sounds interesting.

    It is also quite simple. [ Famous Last Words ]

    If I were you I would put this macro into your personal workbook so you can run it in any active workbook.

    I will assume that this is agreeable and create something for you.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Copy Find All Dialogue Box

    Try this Macro

    Press Ctrl, shift and F on the attachment.

    
    Public MyStr As String
    
    Sub Selector()
    
    'I am using row one for labels so my first usable row is row 2
    pos = 2
    
    'I want to delete the "Search Results" sheet if it exists, So I am going to force an error
    On Error GoTo NewSheet
    
    'This blocks the message "Deleting Sheet Will Lose Data"
    Application.DisplayAlerts = False
    
    'This selects the results sheet, if it does not exist then we will goto NewSheet
    Sheets("Search Results").Select
    
    'This Deletes the Results Sheet
    ActiveSheet.Delete
    
    'This re-enables our error messages
    Application.DisplayAlerts = True
    
    'Create the Results Sheet
    NewSheet:
        Sheets.Add After:=ActiveSheet
        ActiveSheet.Name = "Search Results"
        ActiveSheet.Move Before:=Sheets(1)
    
    'What Text do you want to search for?
    MyStr = InputBox("Enter Text to Find", "Find Text Macro", "select", 100, 100)
    
    'These are my Labels
    Range("A1").Value = strValueToPic
    Range("C1").Value = "Hyperlink"
    
    ' This resets our normal error routines
    On Error GoTo 0
    
    'Quit if search text is empty
    If MyStr = "" Then Exit Sub
    
    'Search for the Search String in each workbook except the results sheet
    For Each ws In Sheets
    
    If ws.Name = "Search Results" Then GoTo Skip
    
    MyName = ws.Name
    
        MyString = ""
    
        With ws.Cells
            Set rngFind = .Find(MyStr, .Cells(1, 1), LookIn:=xlValues, lookat:=xlWhole)
            If Not rngFind Is Nothing Then
                strFirstAddress = rngFind.Address
                
                Do
                    MyString = MyString & MyName & "!" & rngFind.Address & ", "
                    Set rngFind = .FindNext(rngFind)
                Loop While Not rngFind Is Nothing And rngFind.Address <> strFirstAddress
            End If
        End With
        
    'If Match Found then store data in Column A of results sheet
        If MyString <> "" Then
        
    'Convert MyString into an Array, so it is easy to save
            MyArray = Split(MyString, ",")
        
    'Where to save MyArray
            Temp = Range(Cells(pos, 1), Cells(pos + UBound(MyArray), 1)).Address
            
    'Save MyArray, The array is horizontal, transpose makes it vertical
            Sheets("Search Results").Range(Temp).Value = Application.Transpose(MyArray)
            
    'We need to increment pos so the next lot of data is saved below the existing data
           pos = pos + UBound(MyArray)
            
        End If
    
    Skip:
    
    Next
    
    'This Creates The Hyperlinks in Column C
    With Sheets("Search Results")
    
    For Count = 2 To pos - 1
    
    Temp = CStr(Application.Trim(Sheets("Search Results").Cells(Count, 1)))
    
    ActiveSheet.Hyperlinks.Add Anchor:=.Cells(Count, 3), Address:="", SubAddress:=Temp, TextToDisplay:=Temp
            
    Next
    
    
    End With
    End Sub
    Attached Files Attached Files
    Last edited by mehmetcik; 10-23-2015 at 06:41 PM.

  4. #4
    Registered User
    Join Date
    10-22-2015
    Location
    Oneonta, ny
    MS-Off Ver
    2010
    Posts
    30

    Re: Copy Find All Dialogue Box

    Test testing.....

    Hopefully this message will get through. Having troubles accessing the forums on my computer but my phone won't let me reply.

    Thank you so much mehmetcik for the code. It worked perfectly and better than even the code I found before, tried, and lost (if that code had worked). It was broken anyway and I didn't know how to fix it. Thanks again. I'll post a sample of my file with an explanation of what I'm using it for when my computer quits being stubborn.

    MsBBS

    PS. My cell is acting like computer in regard to forum access. :-(
    Last edited by MsBBStacker; 10-24-2015 at 01:04 PM.

  5. #5
    Registered User
    Join Date
    10-22-2015
    Location
    Oneonta, ny
    MS-Off Ver
    2010
    Posts
    30

    Re: Copy Find All Dialogue Box

    To those who helped,

    Thank you for your contributions in helping me to create my file. Due to personal reasons, I haven't included the original file but I have created a sample file that includes no personal information with which others can use and/or improve upon. I would like recommendations to make this more usable. My own recommendations, add words, phrases, and word pieces (ex: ie, ei, ch, th, etc.)

    Anyway, thanks again for the help and I'll appreciate any comments and suggestions in this thread.

    ~ MsBBS
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Copy Find All Dialogue Box

    Thanks for the feedback.

  7. #7
    Registered User
    Join Date
    10-22-2015
    Location
    Oneonta, ny
    MS-Off Ver
    2010
    Posts
    30

    Re: Copy Find All Dialogue Box

    Mehmetcik: Absolutely!

    ----------------------------------------------------------------

    Dear ExcelForum Members and Readers,

    This message is an example message encoded by using the key included with the attached BasicCypher(Condensed) file. If you have decoded this correctly, you can answer the question which I ask:

    Key!G24,Key!H72,Key!H78,Key!E50,Key!C60,Key!M28,Key!Y45,Key!C60,Key!A46,Key!K46,Key!I48,Key!H57,Key!C60,Key!T45,Key!H78,Key!H13,Key!K46,Key!H57,Key!M28,Key!E50,Key!L70,Key!C60,Key!A47,Key!K46,Key!T52,Key!K46,Key!H57,Key!E48,Key!C60,Key!C60,Key!B66,Key!G83,Key!K46,Key!X98,Key!I48,Key!Y45,Key!C60,Key!E63,Key!K46,Key!M28,Key!X98,Key!E50,Key!Y45,Key!C60,Key!M28,Key!T45,Key!C60,Key!A46,Key!K46,Key!I48,Key!C60,Key!I48,Key!Y45,Key!L70,Key!C60,Key!E50,Key!H72,Key!L70,Key!C60,Key!Y48,Key!L70,Key!A46,Key!C60,Key!E50,Key!H78,Key!G83,Key!C60,Key!E50,Key!K46,Key!C60,Key!L70,Key!X98,Key!A47,Key!K46,Key!P27,Key!L70,Key!C60,Key!A46,Key!K46,Key!I48,Key!H57,Key!C60,Key!H78,Key!X98,Key!Y45,Key!G24,Key!L70,Key!H57,Key!L48,Key!L25

    Good Luck!

    ~ MsBBStacker

    PS. - In encoding my first message, I found that this macro found more than just the ? and * when searching for those characters. It also "disliked" the / character. To find the ? and * characters, use ~? or ~*. As far as the / character is concerned, in adding this symbol, I copied it from a text file and probably accidently added an extra space after the /. To search for this, type *SPACE*/*SPACE*. (*SPACE* is the actual space bar, since it's hard to show nothing.) At your discretion, you may "Replace All" by inserting the ' character before the / character to make searching life easier ( example: '/ ). This is something new I just learned. Happy decoding!

+ 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. Dialogue Box To Select A Folder and Copy It To A Shared Drive
    By Learn2010 in forum Access Tables & Databases
    Replies: 1
    Last Post: 09-06-2012, 05:46 PM
  2. Can't use ctrl-a (select all) in Find dialogue
    By John Fry in forum Excel General
    Replies: 4
    Last Post: 08-25-2011, 10:59 PM
  3. Dialogue box needed to copy range
    By yunesm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-08-2010, 06:30 PM
  4. Possible to call Find & Replace dialogue box within Workbook?
    By unley in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-21-2009, 01:35 AM
  5. Changing The Find Default Dialogue.. Possible?
    By Mhz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-08-2007, 04:36 PM
  6. [SOLVED] Can't find Edit, links dialogue box to break the link
    By Angie L. in forum Excel General
    Replies: 1
    Last Post: 10-13-2005, 06:05 PM
  7. copy a cell's contents into find dialogue box
    By tommeyer in forum Excel General
    Replies: 1
    Last Post: 01-18-2005, 03:40 PM
  8. Macro to simply bring up the Find dialogue box??
    By marika1981 in forum Excel General
    Replies: 16
    Last Post: 01-14-2005, 07:06 PM

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