Results 1 to 10 of 12

Thread: Create subroutine VBA to replace keyword in a column

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    Jun 2013
    Posts
    52
    Rep Power
    13
    Wow you guys are awesome. Both things look pretty good. Can the person that posted the file above please explain how this works. I think I understand but im not 100% sure. So better to ask then screw it up.

    I'm assuming that I would create another page and that would become the table for the replacements as I see in your example.

    Column "G' "Searchwhat would be the keywords to look for example "smoke detector" or "Duct Detector"
    Column "h" "replacewith" would be the words that it would be replacing with example "Photo" or "Duct"
    Column "I" 'lookat" would be the column that the macro looks for I assume, In my page it would be column "B" or 2
    I do not understand what column "J" is for "1 whole match, 2 partial match

    I also am confused on what would go in column "A" or "B" that is on your sheet

    Also I assume I would just keep writing words in both columns "G" and "H" and that would be endless poss, as long as I adjust the vba code for the range.

    Thanks again for all the help. I will mess with it a little. Oh I also assume I will have to make the name of the sheet change as well to suit the VBA code.

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://eileenslounge.com/viewtopic.php?p=318868#p318868
    https://eileenslounge.com/viewtopic.php?p=318311#p318311
    https://eileenslounge.com/viewtopic.php?p=318302#p318302
    https://eileenslounge.com/viewtopic.php?p=317704#p317704
    https://eileenslounge.com/viewtopic.php?p=317704#p317704
    https://eileenslounge.com/viewtopic.php?p=317857#p317857
    https://eileenslounge.com/viewtopic.php?p=317541#p317541
    https://eileenslounge.com/viewtopic.php?p=317520#p317520
    https://eileenslounge.com/viewtopic.php?p=317510#p317510
    https://eileenslounge.com/viewtopic.php?p=317547#p317547
    https://eileenslounge.com/viewtopic.php?p=317573#p317573
    https://eileenslounge.com/viewtopic.php?p=317574#p317574
    https://eileenslounge.com/viewtopic.php?p=317582#p317582
    https://eileenslounge.com/viewtopic.php?p=317583#p317583
    https://eileenslounge.com/viewtopic.php?p=317605#p317605
    https://eileenslounge.com/viewtopic.php?p=316935#p316935
    https://eileenslounge.com/viewtopic.php?p=317030#p317030
    https://eileenslounge.com/viewtopic.php?p=317030#p317030
    https://eileenslounge.com/viewtopic.php?p=317014#p317014
    https://eileenslounge.com/viewtopic.php?p=316940#p316940
    https://eileenslounge.com/viewtopic.php?p=316927#p316927
    https://eileenslounge.com/viewtopic.php?p=316875#p316875
    https://eileenslounge.com/viewtopic.php?p=316704#p316704
    https://eileenslounge.com/viewtopic.php?p=316412#p316412
    https://eileenslounge.com/viewtopic.php?p=316412#p316412
    https://eileenslounge.com/viewtopic.php?p=316254#p316254
    https://eileenslounge.com/viewtopic.php?p=316046#p316046
    https://eileenslounge.com/viewtopic.php?p=317050&sid=d7e077e50e904a138c794e1 f2115da95#p317050
    https://www.youtube.com/@alanelston2330
    https://www.youtube.com/watch?v=yXaYszT11CA&lc=UgxEjo0Di9-9cnl8UnZ4AaABAg.9XYLEH1OwDIA35HNIei0z-
    https://eileenslounge.com/viewtopic.php?p=316154#p316154
    https://www.youtube.com/watch?v=TW3l7PkSPD4&lc=UgwAL_Jrv7yg7WWC8x14AaABAg
    https://teylyn.com/2017/03/21/dollarsigns/#comment-191
    https://eileenslounge.com/viewtopic.php?p=317050#p317050
    https://eileenslounge.com/viewtopic.php?f=27&t=40953&p=316854#p316854
    https://www.eileenslounge.com/viewtopic.php?v=27&t=40953&p=316875#p316875
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 07-25-2024 at 01:44 PM.

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    See my comments in red.

    Quote Originally Posted by william516 View Post
    Wow you guys are awesome. Both things look pretty good. Can the person that posted the file above please explain how this works. I think I understand but im not 100% sure. So better to ask then screw it up.

    I'm assuming that I would create another page and that would become the table for the replacements as I see in your example.

    Column "G' "Searchwhat would be the keywords to look for example "smoke detector" or "Duct Detector" - Yes
    Column "h" "replacewith" would be the words that it would be replacing with example "Photo" or "Duct" - Yes
    Column "I" 'lookat" would be the column that the macro looks for I assume, In my page it would be column "B" or 2 - No. If you hit CTRL+H, you see an option 'Match entire cell contents'. If it is checked, lookat - 1, and if it is not, lookat - 2
    I do not understand what column "J" is for "1 whole match, 2 partial match - (explanation of 1 and 2)

    I also am confused on what would go in column "A" or "B" that is on your sheet - Sample data

    Also I assume I would just keep writing words in both columns "G" and "H" and that would be endless poss, as long as I adjust the vba code for the range. - Yes

    Thanks again for all the help. I will mess with it a little. Oh I also assume I will have to make the name of the sheet change as well to suit the VBA code. - Yes
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Find All Empty Blank Cells Or KeyWord In A Column
    By william516 in forum Excel Help
    Replies: 9
    Last Post: 06-25-2013, 05:20 PM
  2. VBA Using MID Function To Replace Portion Of A String
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 1
    Last Post: 05-30-2013, 08:22 PM
  3. Replies: 10
    Last Post: 05-23-2013, 12:30 PM
  4. Replace Pivot Table Source Range with New Address VBA
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 1
    Last Post: 04-25-2013, 07:51 PM
  5. Replace Currency Format From One to Another at One go !! (VBA)
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 07-19-2011, 09:13 PM

Tags for this Thread

Posting Permissions

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