+ Reply to Thread
Results 1 to 3 of 3

Using Find and Replace All Boxes in VBA

  1. #1
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Using Find and Replace All Boxes in VBA

    Dear All,

    Trust you're all doing well.

    I am taking an Excel file and I am restructuring all the VBA codes as well renaming all boxes for easy management.

    At the moment, all boxes are standard name such as “TextBox#”; “CheckBox#” and so on. I have renamed them and need to replace now the new names for all codes.

    Best way I know is to use the “Find and Replace” but I encounter issues when boxes exceeds 2 decimal numbers. For example, if I want to replace all “TextBox1” to “TxBxName” and choose replace all, it will replace e.g. “TextBox13” to “TxBxName3”. What I want is only to replace the “TextBox1” and not the “TextBox11, TextBox12” as this ones have another id/name.

    Is there a workaround to avoid this? The only one I know is to do it one by one and ignore the decimal ones but this will take ages as there are loads of Boxes and codes.

    Please do let me know if you require further clarification.

    Many thanks in advance for your help.

    Best regards,
    Filipe

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Using Find and Replace All Boxes in VBA

    Hi,

    Can you not do it in reverse order? If you replace Textbox13 first, you won't have that problem when you do Textbox1.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Using Find and Replace All Boxes in VBA

    LOL, actually it makes all sense alright!

    Thanks a million xlnitwit, will do it.

    Will keep this thread open to see if there is another way to do it but, in all fairness, will be hard to beat yours

    Appreciate your assistance.

+ 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. [SOLVED] Using find replace to first find two double quotes and replace with a single double quote
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2015, 10:13 AM
  2. [SOLVED] Find and replace where contents a formula so can't be seen by Find and replace.
    By markDuffy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2015, 02:24 PM
  3. Replies: 16
    Last Post: 12-02-2014, 03:38 PM
  4. Replies: 3
    Last Post: 11-25-2014, 06:08 AM
  5. [SOLVED] Find and replace in a certain cell - using input boxes
    By DannyJ in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-09-2012, 06:17 AM
  6. find in excel replace in word: find/replace text in text boxes and headers
    By dean.rogers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2012, 12:40 PM
  7. Find and replace should work in Excel text boxes
    By Bob@Teton in forum Excel General
    Replies: 0
    Last Post: 10-20-2005, 09:05 AM

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