+ Reply to Thread
Results 1 to 4 of 4

Help fixing VBA to find and replace items in different columns

  1. #1
    Registered User
    Join Date
    07-22-2008
    Location
    WV
    Posts
    70

    Help fixing VBA to find and replace items in different columns

    I have three columns I want to perform and find and replace in. I get “Compile error: Duplicate declaration in current scope” and am very new to VBA so not sure what the issue is. Probably something simple if you know what you’re doing. I’ve attached a sample workbook with two sheets “What I Have” and “What I Want” to illustrate what I am trying to achieve with the following code. Thanks for any help.

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

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,375

    Re: Help fixing VBA to find and replace items in different columns

    Heading can't be a Constant. If you want it to have different values, declare it using Dim and then set the value when you want to change it.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-22-2008
    Location
    WV
    Posts
    70

    Re: Help fixing VBA to find and replace items in different columns

    Thanks for the reply. It's honestly a little above my skill without an seeing an example but I did find a solutions that works for me elsewhere making each part it's own Sub statement then using Call in my first Sub statement to call the others. This also helps me keep my scripts segregated so they are easier for me to understand what's going on in each part. i.e...

    Please Login or Register  to view this content.
    Last edited by jambog; 02-15-2021 at 01:55 PM. Reason: Correction

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,375

    Re: Help fixing VBA to find and replace items in different columns

    Just this:

    Please Login or Register  to view this content.

+ 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. find out and replace items
    By raja1964 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-08-2019, 03:27 PM
  2. Find-replace from static table with 2,630 find items
    By OhioRuss in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2018, 12:44 AM
  3. [SOLVED] I need to find and replace two items in the same formula
    By NancyPez in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-16-2016, 08:09 PM
  4. Replies: 6
    Last Post: 02-23-2012, 04:54 PM
  5. Multiple items need find and replace at a time
    By nagaraju in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-23-2009, 10:53 PM
  6. Find and Replace several items
    By rachelreveley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 04:05 PM
  7. [SOLVED] Excel: Be able to mark specifc items in the find/replace mode & a.
    By MJLOVESMICROSOFT in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-22-2005, 07:06 PM

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