+ Reply to Thread
Results 1 to 6 of 6

Copy and pasta into the next empty column

  1. #1
    Registered User
    Join Date
    12-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    51

    Copy and pasta into the next empty column

    Hi guys

    I have the below code but it doesn't actually do what I need it to do. Basically i want to copy and paste the column from WB2 into the next empty column in WB3. Any help would be greatly appreciated.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Copy and pasta into the next empty column

    If I understand you correctly just find the next free column with
    Please Login or Register  to view this content.
    For interest why use 2+1 instead of 3? Is this a mistake?
    Please Login or Register  to view this content.
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

  3. #3
    Registered User
    Join Date
    12-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Copy and pasta into the next empty column

    Hi

    Thanks for your post - yes that i + 2 thingy was an error.

    Your code doesn't quite do what i need it to do. It keeps overriding my data in column B on sheet WB2. Basically when i activate the macro, I want to find the next empty column and paste the data in. so if Column B has data already, then the macro will enter the new data in column C and so forth

    Hopefully that makes sense =/

  4. #4
    Registered User
    Join Date
    08-23-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Copy and pasta into the next empty column

    I am attempting to do this myself as well for a project...I will keep trying but I am not having much luck.

  5. #5
    Registered User
    Join Date
    08-23-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Copy and pasta into the next empty column

    Try adding a column first then pasting the data you want. Please post your final solution if you find one.

    [CODE]Columns("B:B").Select
    Application.CutCopyMode = False
    Selection.Insert Shift:=xlToRight
    Range("A2:A8").Select
    Selection.Copy
    Range("B1").Select
    ActiveSheet.Paste[/1CODE]

  6. #6
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Copy and pasta into the next empty column

    The following code will get the next free column - you need to use a row that contains data so it calculates correctly
    Please Login or Register  to view this content.
    In this case it uses row 3 to determine where next free column is - you will need to adjust this based on your worksheet layout.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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