+ Reply to Thread
Results 1 to 4 of 4

Adding text to missing cells

  1. #1
    Registered User
    Join Date
    04-08-2019
    Location
    Kansas City, MO
    MS-Off Ver
    365 ProPlus
    Posts
    1

    Question Adding text to missing cells

    I am using this code in my macro that fills in any blank cells in column A (First Name) with the word "Friend", if the first name is missing.

    Please Login or Register  to view this content.
    However, if there are no blank cells, I get an error message about it and it stops running. How can I fix this, so that if there are no blank cells, it just keeps going?

    (Forgive me, I realize this is really simple and should be obvious... but I'm new to VBA and can't find the answer!)

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Adding text to missing cells

    Hi

    Maybe this way:

    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Adding text to missing cells

    Do not use
    Please Login or Register  to view this content.
    else you are covering the full column ...

    See next code

    Please Login or Register  to view this content.
    Last edited by PCI; 04-25-2019 at 03:30 PM. Reason: .Range changed to Range => Dot not needed
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Adding text to missing cells

    How about
    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. [SOLVED] Adding missing title based on what text begins with
    By JohnnyBoyxxx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2016, 06:34 PM
  2. [SOLVED] Adding specific text to cells based on another cells data criteria
    By JohnnyBoyxxx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-26-2015, 02:08 PM
  3. Replies: 2
    Last Post: 04-02-2015, 10:34 PM
  4. Adding text to the start and end of a cells text in another cell
    By kubelwagon in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 11-29-2013, 06:36 PM
  5. Replies: 2
    Last Post: 04-06-2012, 02:42 PM
  6. Adding text to cells
    By MAWII in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2005, 04:05 PM
  7. Re: Adding two text cells together
    By Ron de Bruin in forum Excel General
    Replies: 0
    Last Post: 02-24-2005, 05:06 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