+ Reply to Thread
Results 1 to 3 of 3

Need a macro to copy down the value in the cell until the next value, then again

  1. #1
    Registered User
    Join Date
    12-21-2016
    Location
    Canberra
    MS-Off Ver
    365
    Posts
    2

    Need a macro to copy down the value in the cell until the next value, then again

    As per the title, I need a macro to copy down the value in the cell until the next value occurs (blank cells in between), then again and so on until it has populated all the blank cells in the column, and then for the macro to stop. It sounds so simple that I'm sure it must be, but I have spent some time on this now and I'm no closer to any solution. This is because I know nothing about VBA code and apparently not much about macros. Anyone answering please can you treat it as if I know nothing and if code can be provided then also please explain how I use the code i.e. get it into a macro. Thanks in advance ...

  2. #2
    Forum Contributor
    Join Date
    05-02-2015
    Location
    calgary alberta
    MS-Off Ver
    2012
    Posts
    205

    Re: Need a macro to copy down the value in the cell until the next value, then again

    Care to post a quick sample so we can see where the columns lie

  3. #3
    Registered User
    Join Date
    12-21-2016
    Location
    Canberra
    MS-Off Ver
    365
    Posts
    2

    Re: Need a macro to copy down the value in the cell until the next value, then again

    ok, so the file is structured as per below - Column A is far left. This hasn't copied properly and the ZZZ codes are in column B, the cells in column A next to those codes is currently blank.

    In this example I want to populate below 'AL' down to where the next Code 'LWOP' starts,
    and so on and so on, until it reaches the last code. It doesn't matter if blank rows get populated i.e. the cell immediately above the second instance of
    each code, as I'm making the data read accross to cells in columns to the right of those shown below, and will filter on a related value cell (not shown) to
    remove any nil values. I hope that makes sense.

    ____________________________________________________
    Data Dump Zone - Income & Allowances

    Attache COMPANY
    DATE INCOME TYPE REPORT Page: 1
    For Date Paid 01/11/2016 to 30/11/2016

    Code

    AL ANNUAL LEAVE
    ZZZ1 NAME1
    ZZZ2 NAME2
    ZZZ3 NAME3

    AL ANNUAL LEAVE


    LWOP Leave Without Pay
    ZZZ1 NAME1
    ZZZ2 NAME2
    ZZZ3 NAME3

    LWOP Leave Without Pay

    etc ...

    ___________________________________________
    Last edited by pvast; 12-21-2016 at 12:37 AM.

+ 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. Replies: 1
    Last Post: 07-22-2015, 05:23 PM
  2. [SOLVED] Macro to copy cell value of Sheet1 to next empty cell of colum A in Sheet 2
    By JamesFinch in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-15-2014, 02:54 PM
  3. Replies: 3
    Last Post: 04-04-2014, 11:34 AM
  4. Replies: 1
    Last Post: 01-03-2014, 03:01 AM
  5. Replies: 1
    Last Post: 11-06-2013, 02:56 AM
  6. [SOLVED] Macro to copy cell width to new sheets (ie copy original sheet format)
    By teenyjem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2013, 07:28 AM
  7. [SOLVED] Macro to copy cell contents from the Header sheet into cell A2 on all worksheets
    By jsantos in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-15-2012, 06:28 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