+ Reply to Thread
Results 1 to 2 of 2

Copy and Paste to first Blank Column

  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    minnesota
    MS-Off Ver
    Excel 2013
    Posts
    16

    Copy and Paste to first Blank Column

    I have a vba macro that runs and solves some thing that puts data in to Columns A:C which i then paste to sheet 2 in columns A:C. Now the macro keeps running and puts a different set of data in Columns A:C on Sheet1 how do i get this to automatically copy to the first blank column in Sheet2. It does this many times over which is why I'm looking to copy to the first blank column?

    Thanks
    Adam

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,447

    Re: Copy and Paste to first Blank Column

    Hi Adam,

    It sounds like you need to find the first blank column moving to the right. To do this you need...

    Dim LastCol as double

    LastCol = cells(1,Columns.Count).End(xlToLeft).Column


    The above code starts in Row 1 and the right most column and then does a Ctrl+Right to hit the first cell which isn't empty. That column number is LastCol. You then need to add 1 to this number to see which column to paste your next chunk of data. If you supply a sample workbook it is much easier to show you.



    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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. Replies: 0
    Last Post: 10-29-2015, 04:15 PM
  2. [SOLVED] Copy last 3 columns, paste into next blank column macro
    By rossp1977 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-16-2015, 11:06 AM
  3. Macro: Copy/Paste values From Column to Next Blank Row
    By Lisseth225 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-23-2014, 05:39 PM
  4. [SOLVED] Copy data and paste in first blank row of Column A
    By Hood in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-08-2014, 08:48 AM
  5. [SOLVED] Macro to copy columns and paste into one column in next blank column
    By rmmohan in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-31-2013, 03:14 PM
  6. [SOLVED] Copy and Paste formula into alternative blank column.
    By DancingElvisLives in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2012, 07:21 AM
  7. Copy Data from Column and Paste to Next Blank Column on 2nd Sheet
    By adammark in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-19-2010, 11:15 AM

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