+ Reply to Thread
Results 1 to 2 of 2

help with code that fills in blanks

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    help with code that fills in blanks

    Hello. Can someone explain this code? It's for filling in labels where there are blanks, so A1= Jim A2:10=Jim A11=Bob A12:A20= Bob etc. How does the second line do this? It seems like it's just copying everything from A1. And the first line is saying copy cell before but how does it know to start from the top?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: help with code that fills in blanks

    Hi,

    if there are no blank cells within the currentregion, using specialcells will return an error, which is why the line

    Please Login or Register  to view this content.
    is used.

    The formula "=R[-1]C", which is applied on the blank cells, will give you a reference to the next cell (one row up). If row 1 withing the currentregion is blank, consider changing changing the code for defining the range area -- you may also want to limit this to specific columns?

    another alternative that does the same,

    Please Login or Register  to view this content.
    hope it helps -- on vacation so maybe not the most detailed post..

    cheers, berlan
    Last edited by berlan; 07-24-2015 at 02:21 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. skipping blanks in code
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2015, 07:15 PM
  2. VBA code for skipping blanks
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2015, 05:56 PM
  3. Replies: 6
    Last Post: 06-17-2014, 11:11 AM
  4. [SOLVED] Clicking on cell that auto fills an X and removes all other auto fills in a range
    By ERaasio in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-26-2013, 12:31 PM
  5. Command button code that fills two combo box values and a toggle in cell
    By vdongen in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-03-2010, 12:03 AM
  6. Blanks and fills
    By Car Man in forum Excel General
    Replies: 1
    Last Post: 04-24-2005, 10:34 AM
  7. [SOLVED] Macro Fills in the blanks
    By Amanda in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2005, 09:06 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