+ Reply to Thread
Results 1 to 6 of 6

Add text to cell only where values exist in rows

  1. #1
    Registered User
    Join Date
    11-23-2010
    Location
    Leicester, England
    MS-Off Ver
    Excel 2021 Pro Plus
    Posts
    87

    Add text to cell only where values exist in rows

    Hi, I've tried to work this out from other macros I have, but no joy...

    I need to add text "UKMAIL" to cells in Column B2, B3, B4 etc, but only those rows that contain values in Column C.

    I'm sure this will be a simple code, but unfortunately not for my amount of knowledge...

    Thanks in advance for any help

    Kindest regards
    Mike

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Add text to cell only where values exist in rows

    How about

    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Add text to cell only where values exist in rows

    Or filter out the "blanks" in column C and add required text to visible cells

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-23-2010
    Location
    Leicester, England
    MS-Off Ver
    Excel 2021 Pro Plus
    Posts
    87

    Re: Add text to cell only where values exist in rows

    Hi Kev, the first option worked perfectly fine, thanks!
    I've just tried to do a little bit of tidying up to clear the borders from cols A to D, by adding to some code that already does some formatting on those cells, but It doesn't seem to work. Here's the existing code:
    Please Login or Register  to view this content.
    I just added
    Please Login or Register  to view this content.
    , but it doesn't clear the borders.
    What am I doing wrong?

    Kind regards
    mike

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Add text to cell only where values exist in rows

    Code looks ok. Have you selected anything?
    That is what you asking VBA to use
    Try replacing
    Selection....
    with
    Columns("A:D")...

  6. #6
    Registered User
    Join Date
    11-23-2010
    Location
    Leicester, England
    MS-Off Ver
    Excel 2021 Pro Plus
    Posts
    87

    Re: Add text to cell only where values exist in rows

    Doh...

    Works great.
    Thanks again Kev

    Kind regards
    Mike

+ 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] Count cell if values exist else skip
    By sabeelahmedks in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-06-2018, 07:17 AM
  2. Replies: 5
    Last Post: 07-18-2017, 02:45 PM
  3. [SOLVED] VBA to delete rows if certain text exist in cell & fill with formula
    By johnmacpro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2016, 05:46 PM
  4. [SOLVED] Check First IF Sheet Is Exist With The Name Of Cell K7 If exist Then run the code
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-18-2015, 10:08 AM
  5. [SOLVED] Determining if duplicate values exist across a row (then do that over 2000 rows)
    By TDSexcel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-19-2014, 07:21 PM
  6. Replies: 8
    Last Post: 04-12-2012, 08:02 PM
  7. List row numbers where cell values exist
    By maxald in forum Excel General
    Replies: 8
    Last Post: 06-07-2010, 07:45 AM

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