find within workbook using macro
Results 1 to 4 of 4

Thread: find within workbook using macro
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Jan 2007
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default find within workbook using macro

    Hi,
    I wanted to encode finding a particular string within the whole workbook. I tried to record it using macro recorder but I didn't get the desired code i.e. whatever code I got finds it only within the worksheet.
    I tried searching it on excel vba help but it seems that the find mehod is restricted at worksheet level.
    Actually this seems a little tough to digest as there doesn't seems to be any reason for disabling any option in macros which is available while doing it manually.
    Any kind of inputs from you to help me find within workbook using macro will be highly appreciated!

    Thanks,
    Nachiket Pendharkar.

  2. #2
    MrExcel MVP erik.van.geit's Avatar
    Join Date
    Feb 2003
    Location
    Belgium 3272 Testelt
    Posts
    17,832
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    You will need to loop through your worksheets.

    Code:
    For Each ws In ThisWorkbook.Worksheets
    ....
    Next ws
    If you need more help it could be good to post the code you are using for the single sheet.

    kind regards,
    Erik
    I love Jesus

    email Erik

    founder of DRAFT

    my free Addins
    Table-It download & info
    Formula Translator 04

  3. #3
    Board Regular
    Join Date
    Jan 2007
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Erik,
    Yeah looping is always an alternative(which, in fact, what i have used in my macro). But it definitely will be much faster to find it once and for all, across all worksheets, that was my obejctive.

    Thanks anyway for your time,
    Regards,
    Nachiket Pendharkar

  4. #4
    MrExcel MVP erik.van.geit's Avatar
    Join Date
    Feb 2003
    Location
    Belgium 3272 Testelt
    Posts
    17,832
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    you're WELCOME!

    I really do not think there is an alternative for the loop.
    I love Jesus

    email Erik

    founder of DRAFT

    my free Addins
    Table-It download & info
    Formula Translator 04

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •