+ Reply to Thread
Results 1 to 25 of 25

search files across multiple sheets and open & highlight by inputbox

  1. #1
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    search files across multiple sheets and open & highlight by inputbox

    hello
    I need macro search file across multiple sheets so I would that by inputbox first open inputbox ask me write the sheet then active the sheet and show another inputbox to write the file name based on active the sheet if there is existed then show message contains two choices if yes then open the file and highlight the file name is in located the cell and shows me another message where is address the cell and if it's not then nothing happens and when run again the input box then return any cell highlighted to xl none color and if I write wrong file name show me message the file is not existed
    note: my directory file is ": c:\users\ose\files\
    and when search in folder and subfolders
    I issue also in this forum nobody answers so far
    http://www.vbaexpress.com/forum/show...-amp-highlight
    thanks in advance
    Attached Files Attached Files
    Last edited by ABDELFATTA; 04-12-2021 at 02:30 AM.

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    Possibly...
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    thanks but when I write the file name it gives me it doesn't existed I'm sure about the same name whether in sub folder or sheet "PDF"
    the same thing I use copy and paste to avoid the wrong writing the name capital or small letters , do you have any idea?

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    Try just selecting the cell with the file name.

  5. #5
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    I select the cell what I look for it doesn't change

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    I changed this version to choose the file by typing in the name instead of selecting a cell.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    gives error type mismatch in this line
    HTML Code: 

  8. #8
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    Try
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    it gives me doesn't existed file I'm sure about the file name is existed in directory and inside the sheet

  10. #10
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    The displayed message shows the path and filename it could not find. Is it the path and file name you expected?

  11. #11
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    Possibly a different approach...
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    thanks so much for you following to solve my problem
    honestly I no know where is the problem I run the code in my PC in post#8 in version office 2019 it doesn't open the file and when I run another PC and the version office 2010 it works excellently I tested the code in post # 11 iI don't prefer open by browser because if I have many files it's difficult to find the file but in post #8 it's great ,so I would final thing I would highlight by red color the cell which contains file name what I look for it before this message
    HTML Code: 
    and when open the file it the color is gone

  13. #13
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    after show this message
    HTML Code: 
    it shows error and open the file normal without highlight before the message and I can't see which line debug
    Attached Images Attached Images

  15. #15
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    When you click on 'Debug' what line is highlighted?

  16. #16
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    I follow by F8 and this stop at this line
    HTML Code: 

  17. #17
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    Try
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    unfortunately still the error shows in the end of code , and i have a note when I run f8 it should highlighted by red color when reach after this line
    HTML Code: 
    but it's nothing happens , do you have any idea why doesn't highlight by red ?

  19. #19
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    Probably because it could not find the file name

  20. #20
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    but if it's so then doesn't the open file the problem all of the steps by F8 from begnning search the sheet to ending open the file work normally and show the error in end the code without highlight the color and returns

  21. #21
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    I don't know why. Can you post this workbook?

  22. #22
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    this is my file
    Attached Files Attached Files

  23. #23
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    Try this...
    Please Login or Register  to view this content.

  24. #24
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: search files across multiple sheets and open & highlight by inputbox

    awesome !! you're super great buddy
    you've given me a big favor many thanks for astonishing code

  25. #25
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: search files across multiple sheets and open & highlight by inputbox

    Glad to know it works for you!

+ 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. adjusting code search in multiple sheets using by inputbox
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2020, 02:17 AM
  2. VBA Macro - open and copy sheets from multiple files
    By Eden101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2019, 10:18 AM
  3. Search for files with inputbox and wildcards
    By qontrol in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2015, 03:35 PM
  4. Open multiple text files to different sheets and save each sheet seperately
    By lance01 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2014, 10:20 AM
  5. Search for a string in multiple excel files with multiple sheets
    By ghermanu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2012, 05:46 PM
  6. [SOLVED] Open Files via InputBox
    By Maria in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2005, 11:06 AM
  7. Inputbox Search specific sheets
    By DDH in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-03-2005, 11:54 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