+ Reply to Thread
Results 1 to 2 of 2

trying to populate the first blank cell in a row with a specific text value

Hybrid View

  1. #1
    Registered User
    Join Date
    05-14-2014
    MS-Off Ver
    Excel 2013
    Posts
    15

    trying to populate the first blank cell in a row with a specific text value

    I am trying to use VBA to populate the first blank cell in row 6 with the word "Short"

    I keep getting sub or function not defined and I am sure its because I am trying to Frankenstein some code together to get it to work. So far everything works as I need but this last step.

    Any help would be appreciated.

    Thanks

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: trying to populate the first blank cell in a row with a specific text value

    Try this:

    Sub RunMe()
    Dim rCell As Range
    
    On Error GoTo End1
    For Each rCell In Range(Cells(6, 1), Cells(6, Cells(6, Columns.Count).End(xlToLeft).Column)).SpecialCells(xlCellTypeBlanks)
        rCell.Value = "Short"
        Exit For
    Next rCell
    End1:
    
    End Sub
    Last edited by stnkynts; 05-28-2014 at 01:09 PM.

+ 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] How to insert blank row above a cell containing specific text
    By Excelfail in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-23-2019, 09:19 AM
  2. Deleting rows if specific cell is blank or have specific text
    By JoaoFerreira1985 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2013, 01:18 PM
  3. Function to populate cell with specific text from an external txt file
    By exoscoriae in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-02-2013, 07:34 AM
  4. How to insert blank row below a cell containing specific text
    By Lmsloman in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-15-2012, 02:59 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