+ Reply to Thread
Results 1 to 10 of 10

VBA script that will allow me to copy the unit # in column C to the empty cells below unti

  1. #1
    Registered User
    Join Date
    09-08-2023
    Location
    Canada
    MS-Off Ver
    365
    Posts
    4

    VBA script that will allow me to copy the unit # in column C to the empty cells below unti

    I would like to create a VBA script that will allow me to copy the unit # in column C to the empty cells below until it reaches the next unit #, then copies that unit # to the empty cells below it until it reaches the next unit# and so on.

    I have attached a sample excel spreadsheet.

    Really appreciate any help.

    Thanks
    Attached Files Attached Files
    Last edited by FFarah; 09-09-2023 at 01:16 AM. Reason: error

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: VBA script that will allow me to copy the unit # in column C to the empty cells below

    Please Login or Register  to view this content.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: VBA script that will allow me to copy the unit # in column C to the empty cells below

    Hi there,

    Assuming the first Unit code to copy is in cell C6 (row 6).

    Try the code below;



    Please Login or Register  to view this content.
    Last edited by ORoos; 09-09-2023 at 03:21 AM.
    If your Question is answered; please mark it SOLVED. If you are happy with a member's solution, say 'Thanks' and click the 'Star' to Add Reputation.

  4. #4
    Forum Contributor
    Join Date
    07-24-2023
    Location
    Como, Italy
    MS-Off Ver
    MSO 365 - Ver 2208
    Posts
    120

    Re: VBA script that will allow me to copy the unit # in column C to the empty cells below

    Hi FFarah,

    this is another version
    Please Login or Register  to view this content.
    Try and let us know.

    Bye

    P.S.: if you want only value of cell, modify
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    Last edited by maxpit; 09-09-2023 at 08:29 AM.
    Max
    let's compare ideas

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: VBA script that will allow me to copy the unit # in column C to the empty cells below

    Or try this. No loop.

    Please Login or Register  to view this content.
    Last edited by TMS; 09-09-2023 at 09:00 AM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: VBA script that will allow me to copy the unit # in column C to the empty cells below

    Thanks for the rep.

    Let us know how you get on.

  7. #7
    Registered User
    Join Date
    09-08-2023
    Location
    Canada
    MS-Off Ver
    365
    Posts
    4

    Re: VBA script that will allow me to copy the unit # in column C to the empty cells below

    Thanks so much your script worked fine

  8. #8
    Registered User
    Join Date
    09-08-2023
    Location
    Canada
    MS-Off Ver
    365
    Posts
    4

    Re: VBA script that will allow me to copy the unit # in column C to the empty cells below

    hanks. Worked fine

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: VBA script that will allow me to copy the unit # in column C to the empty cells below

    You're welcome.

  10. #10
    Registered User
    Join Date
    09-08-2023
    Location
    Canada
    MS-Off Ver
    365
    Posts
    4

    Re: VBA script that will allow me to copy the unit # in column C to the empty cells below

    Thanks your script worked fine

+ 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] Find the last row on column A -> copy the row from A unti H-column
    By Tsinos in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-28-2022, 06:47 AM
  2. Need A Fast Script To Copy 80000 Cells But My Current Script Is Too Slow
    By Genus Max in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-20-2019, 09:54 AM
  3. VBA Script To Copy & Paste Values & Formatting To First Empty Row
    By cfcMalky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2019, 04:37 AM
  4. Copy cells to next empty column
    By A440 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2015, 11:34 AM
  5. [SOLVED] Copy all cells in column that contain data & paste to first empty row of another column.
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2014, 08:45 AM
  6. Need to find empty filled cells in a column and copy to the empty cell below
    By Grahamfeeley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-30-2014, 10:09 AM
  7. Copy a formula to cells in column A which don't have an empty cell in column B
    By floep in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2006, 04:57 AM

Tags for this Thread

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