Results 1 to 4 of 4

Thread: Drag and Fill Code Help

  1. #1

    Drag and Fill Code Help



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello all, I'm in my mid fifties and completely new to computing and particularly excel. I am recently retired due to ill health and started a project to teach myself through online tutorials and Youtube videos.
    Forgive my method of explaining what I require as I know no other way with the use of proper technical terms/language.

    I have a worksheet where I would like to have excel automatically drag and fill into empty cell columns.

    The cells in the range are H1:AP1501

    So the range for each column that the code should only effect is H1:H1501, I1:I1501, J1:J1501, K1:K1501 and so on across as far as AP1:AP1501

    The code should search in the range H1501:AP1501 for blank/empty cells in this range.

    Any blank cell in this range should be filled, so if P1501 is blank and Q1501 is not, the range P1:P1501 should be filled with whats in the range Q1:Q1501

    When I say filled I mean that Q1:Q1501 contents should be dragged into P1:P1501 not duplicated in so appearing twice on the worksheet.

    I cannot just simply delete a column, as there is data in all columns past row 1501.

    I would be extremely grateful if someone could provide me with the code that I can copy & paste in to do the above.


    Thanking You In Advance.

  2. #2
    Super Moderator Bob Phillips's Avatar
    Join Date
    Mar 2011
    Posts
    1,820
    Articles
    0
    Excel Version
    O365
    Are you saying that if P1:P700 has data (formulae?), but P701 does not, you want Q1:Q701 copied over to P1:P701?

  3. #3
    Yes, the whole range should be copied over. Q1:Q1501(inclusive) replaces P1:P1501,


    There are 35 columns are in the range H1:H1501 to AP1:AP1501

    H1:AP1 are header cells

    Lets say there are 35 Salesmen in the Company

    18 called Mike

    17 called John

    H1 = Mike 1
    I1 = John 1
    J1 = Mike 2
    K1 = John 2
    L1 = Mike 3
    M1 = John 3
    and so on across to AP1

    So we can see 18 mikes and 17 johns across the worksheet

    as it happens in the range H1501:AP1501 only the cells under a salesman called mike have data in them the john cells are blank in the range h1501:ap1501

    drag and fill all the mikes across so now all that can be seen are 18 mikes with no johns at all

    the range to drag is always 1:1501 inclusive

  4. #4
    Any chance of a reply?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •