+ Reply to Thread
Results 1 to 9 of 9

Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

  1. #1
    Forum Contributor
    Join Date
    03-14-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 365
    Posts
    105

    Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

    Dear All,

    I have this piece of code that will add the word "Comment" at the begining of any cell that is not blank in a specific range, the problem is that the macro run after an userform load the information into the cells, so every time new information is added throught the userform the word "Comment" is added, as a result the cell will have multiples "Comment" added.
    I want to modify the code so it will check if the word "Comment" is already present, if no then it will added, but if is then will do nothing.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,830

    Re: Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 365
    Posts
    105

    Re: Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

    Mumps1,

    Thank you for your fast response, the code is adding it to all the cells, the first condition is true for my initial code, only added if the cell is not blank. how can we combine both conditions

    Thanks again for your help, your time is highly appreciated.


    Respectfully,

    Alex

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

    Maybe
    Please Login or Register  to view this content.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,830

    Re: Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

    I think that jolivanes has given you the solution.

  6. #6
    Forum Contributor
    Join Date
    03-14-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 365
    Posts
    105

    Re: Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

    Jolivanes,

    Thank you very much for your help, I work perfectly!!, this solution save me a lot of time

    I really appreciate your time.

    Respectfully,

    Alex

  7. #7
    Forum Contributor
    Join Date
    03-14-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 365
    Posts
    105

    Re: Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

    Mumps1,

    Tank you very much for your help and time, I really appreciate it.

    Respectfully,


    Alex

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

    Hi Alex.
    Mumps1 did all the work. I just happened to pass through and put in my two cents worth.
    Anyway, you're happy so we're happy.
    Good luck

  9. #9
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,830

    Re: Help Midifiying a Macro to add a Text to a Cell Only if it is not Present

    Glad it all worked out.

+ 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] Macro to create text files with Names present in cell
    By khalidness in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-12-2014, 08:49 AM
  2. Delete contents of cell if text is NOT present
    By rexer231 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2014, 12:32 PM
  3. delete contents of cell if text is present
    By rexer231 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2014, 02:01 PM
  4. [SOLVED] Change cell colour based on text being present - conditional formatting?
    By rob-the-randy-rascal in forum Excel General
    Replies: 8
    Last Post: 08-01-2013, 11:24 AM
  5. Replies: 2
    Last Post: 01-07-2013, 08:20 AM
  6. [SOLVED] Macro to sum based on certain text being present, range changes at variable rows
    By mistye525 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-26-2012, 08:02 PM
  7. Copy For Cell Values Present and not Formulas Present
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2009, 12:10 PM

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