+ Reply to Thread
Results 1 to 4 of 4

Copy & paste a cell value on every row of a new column until You reach an empty row

  1. #1
    Registered User
    Join Date
    03-14-2012
    Location
    Milan, Italy
    MS-Off Ver
    Excel 2010
    Posts
    5

    Copy & paste a cell value on every row of a new column until You reach an empty row

    Hi all!

    I need help to finish to produce a macro that does the following:
    a - copy a value (which is always in the A2 Cell);
    b - insert a new column at the beginning of the sheet (col A);
    c - paste the value (step a) in every row of the newly born column (step b) and stops pasting when the rows ar not populated anymore.

    A little step backward.....

    I've already created a macro that erases all the empty rows (unfortunately it is NOT a table but a kind of invoice converted in an excel file); then I've created the code to copy the value, to insert the column and now I need to stop the loop as soon as the cell in column B starts to be empty.

    EXAMPLE (original file):

    A B C D E F G
    1 1 22 d 31 gg tr
    2 36855 2 77 e 59 bb es
    3 5 22 g 14 nn nm
    4 7 33 o 27 ed lp
    5
    6


    EXAMPLE (new column inserted):
    A B C D E F G
    1 36855 1 22 d 31 gg tr
    2 36855 36855 2 77 e 59 bb es
    3 36855 5 22 g 14 nn nm
    4 36855 7 33 o 27 ed lp
    5 STOP
    6


    So it shall paste the value A2 in the newly created A column 'yil B* is NOT NULL

    i would really appreciate any help !
    Last edited by s_vinti; 03-15-2012 at 05:16 AM.

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Copy & paste a cell value on every row of a new column until You reach an empty row

    Hi s_vinti

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Registered User
    Join Date
    03-14-2012
    Location
    Milan, Italy
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Copy & paste a cell value on every row of a new column until You reach an empty row

    I really don't understand what You mean with "code tags", sorry!
    If You want You/I can erase the code, however i put a clear example

  4. #4
    Registered User
    Join Date
    03-14-2012
    Location
    Milan, Italy
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Copy & paste a cell value on every row of a new column until You reach an empty row

    It's ok now?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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