+ Reply to Thread
Results 1 to 6 of 6

Replacing texts and cases

  1. #1
    Registered User
    Join Date
    12-26-2011
    Location
    ---------
    MS-Off Ver
    Excel 2007
    Posts
    4

    Replacing texts and cases

    Hello Guys!


    This is my first post here! I'm from Hungary and I'm an excel freak


    I've an excel file, in column "A" I do have texts (approx 120 lines) which I would like to replace by column "B". I've created the macro, which loops line by line and replace the cell A by cell B on a second sheet where hell of texts are. The macro works fine but I would like to add a function. I would like to know how many times the macro replaced that particular text and I would like to the macro that it is writing the number in cell C. Is it possible somehow?

    Thanks for you replies in advance!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Replacing texts and cases

    That's pretty easy to do, the exact code would be affected by your current macro. Post your current macro and we can offer an exact solution. As per forum rules, be sure to post your code in code tags, like so:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-26-2011
    Location
    ---------
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Replacing texts and cases

    Thanks!


    Here is my code:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-26-2011
    Location
    ---------
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Replacing texts and cases

    Hello Guys!

    Can you help me?

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Replacing texts and cases

    Sorry, holidays....

    Something like this with no unnecessary "selecting":

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-26-2011
    Location
    ---------
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Replacing texts and cases

    Thanks, but this is only a replace code. I would like to see how many times the macro replaced an object.

    Thanks!

+ 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