+ Reply to Thread
Results 1 to 10 of 10

Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    72

    Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    Hi to all

    I think the title describe all, but anyway. It's possible to do UserForm like function Ctrl+F for search in Excel sheet. Yes i know that is a little silly question but it will be cool if this possible
    I have already work with macros, not some big one. Maybe if some one have starting point or better practical example.

    Nice day ahead to all !

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    I'd investigate the UserForm in Excel and look at the Find VBA class, using the help. Why you want to reinvent the wheel?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    08-13-2012
    Location
    Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    you're write. It is just for visualization. I want put search field above the table for quick search (most for amateurs users). Sorry i don't understand you first sentice very well, is possible to do it or not ?

    Thank you!

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    So you want a text box on your worksheet for searching, not to redesign the search form?

  5. #5
    Registered User
    Join Date
    08-13-2012
    Location
    Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    exactly

  6. #6
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    Your post is misleading then.

    You need to have the VBA find function


    Range(Range("a:a").Find(TextBox1.Value, Cells(1, 1), xlValues, XlLookAt.xlPart, , xlNext, False).Address).Select


    using TextBox1.Value for example as what to look for.

  7. #7
    Registered User
    Join Date
    08-13-2012
    Location
    Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    Yes i think u are right,

    But this is great is just that what i was looking for Can you please just help me to make without textbox (textbox will be cell (A1 Example)). best will be on practical example.

    Thank you!

  8. #8
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    Range(Range("a:a").Find(range("a1").Value, Cells(1, 1), xlValues, XlLookAt.xlPart, , xlNext, False).Address).Select

  9. #9
    Registered User
    Join Date
    08-13-2012
    Location
    Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    Work great! Thank you! but i have one more question why not work if i change Range ("a:a") to example Range ("c:c") ?
    And can you please help me write if statement if noting if found than display bsgbox?
    Last edited by zeko90; 05-22-2014 at 03:31 AM.

  10. #10
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Use VBA and UserForm for Search in Excel Sheet (Like Ctrl+F)

    Hi..

    Here's one I made a while ago..

    In the Attached Workbook.. Press CTRL + s to run the Sub...

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. Replies: 0
    Last Post: 02-27-2014, 04:43 PM
  2. Replies: 3
    Last Post: 08-02-2013, 12:06 PM
  3. Search data from sheet & display in the userform
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2013, 01:08 PM
  4. Search and Display in another sheet Using VBA and userform
    By Simar in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-22-2013, 03:35 PM
  5. UserForm to search sheet, show results on separate userform?
    By egemenkepekci in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2010, 01:06 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