+ Reply to Thread
Results 1 to 15 of 15

How to Update One Tab With Find & Replace VBA Code???

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    How to Update One Tab With Find & Replace VBA Code???

    All,

    My find and replace code is going to all the tabs in my workbook, but I want it to stop in my current spreadsheet I am on. Here is my code:

    'Open up charts workbook.
    Workbooks.Open ("E:\Reports\Charts\030.xls")
    
    'Goes to last tab.
    Worksheets(Worksheets.Count).Activate
    
    'Open the find and replace dialog box in the charts worksheet, so you can change the labor information.
    Application.Dialogs(xlDialogFormulaReplace).Show
    
    'Save charts spreadsheet.
    ActiveWorkbook.Save
    How do I make it only do the current tab I am in? I have it go to to the last tab to update it, but it wants to update them all!! Please help me- SEOT
    Last edited by VBA Noob; 07-28-2008 at 04:02 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    If I understand your question, that's an option in the Find and Replace dialog. Click Options, then select Sheet in the first drop-down.

  3. #3
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    shg- Don't have that option with my code???

    Shg,

    I don't have that option with the code I am using. I have that option when I do it manually via picking the Find under the Edit menu. I don't know how to do this using VBA code though. thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    OK, then I don't understand ...

    You're displaying the find and replace dialog, so someone has to enter what to find and what to replace it with. If that's correct, then they can set the option. If there is a way to manipulate the option from VBA, I don't know it.

    If you want instead to dump the dialog and do the find and replace in VBA, that's possible.

  5. #5
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    S

    SHG,

    I used the following code for a find

    Application.Dialogs(xlDialogFormulaReplace).Show
    , but it kept asking me for a path of the file everytime it came to a replacing the information. I had about a 100 replacements so this would not work. Do you know anything else to do??? I can't think of anything at the moment. I keep looking though. Is there a find and replace? I did not see one besides using the code mentioned above. Please help

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    What are you trying to do?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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