+ Reply to Thread
Results 1 to 8 of 8

vba for copy paste to blank cell

  1. #1
    Registered User
    Join Date
    11-14-2008
    Location
    UK
    Posts
    12

    vba for copy paste to blank cell

    Hi all,

    I hope you can help me - I have searched the web but no luck

    Right, what I need is a vba code that copies a range in a sheet and then paste it in the next available blank column.

    Illustration:

    A B C AB
    1 8
    9 7
    6 4

    What I need it to do is copy cells in column AB then paste it in column B then when B has data paste in Column C.

    Note: all the data will be held in the same sheet.

    Hope this makes sense.

    Thanks for your help in advance
    Last edited by Lazypanda; 11-14-2008 at 08:04 AM.

  2. #2
    Registered User
    Join Date
    11-14-2008
    Location
    UK
    Posts
    12
    *Numbers 8,7 and 4 should be below AB in the illustation.
    Last edited by Lazypanda; 11-14-2008 at 08:06 AM.

  3. #3
    Forum Contributor wamp's Avatar
    Join Date
    11-10-2008
    Location
    Norway
    MS-Off Ver
    97, 2000 & 2003 (diff. workstations)
    Posts
    184
    Hi.
    Save this code as a macro and run it.
    Please Login or Register  to view this content.
    note: always make backup of your spreadsheet before trying out new codes/macros.

  4. #4
    Registered User
    Join Date
    11-14-2008
    Location
    UK
    Posts
    12
    Hi Wamp,

    Thanks for your help.

    I have tried the code you suggested but it is not doing what I want. It copies column AB then paste it in AC and when I repeat it the action is the same.

    I need it to copy column AB then paste it in the next availble blank column after column A as illustrated in my first post. I need to be able to repaeat this action multiple times.

    Hope you can help.

  5. #5
    Registered User
    Join Date
    11-14-2008
    Location
    UK
    Posts
    12
    Please help

  6. #6
    Forum Contributor wamp's Avatar
    Join Date
    11-10-2008
    Location
    Norway
    MS-Off Ver
    97, 2000 & 2003 (diff. workstations)
    Posts
    184
    that's strange.
    here's what the code is supposed to do..
    Please Login or Register  to view this content.
    so far so good.. this seemed to work.

    Please Login or Register  to view this content.
    it works flawlessly on my machine..
    could you upload your excel file?

  7. #7
    Registered User
    Join Date
    11-14-2008
    Location
    UK
    Posts
    12
    The macro isn't working for me properly. I have attached my test file with the macro that i have been using.

    It copies the data in AB into AC and and repeats the same action - it does not move to AD once AC has data.

    I need it to start from column A then move across.

    I appreciate you taking your time to help me.
    Attached Files Attached Files

  8. #8
    Forum Contributor wamp's Avatar
    Join Date
    11-10-2008
    Location
    Norway
    MS-Off Ver
    97, 2000 & 2003 (diff. workstations)
    Posts
    184
    Sorry for the late reply.

    My code was based on there beeing something in column B.

    here is the corrected code:

    Please Login or Register  to view this content.

+ 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