+ Reply to Thread
Results 1 to 4 of 4

VBA code to copy n rows of data and paste into every second column

  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2007
    Posts
    3

    VBA code to copy n rows of data and paste into every second column

    I'd be grateful for help with the following problem. I'm looking for code to copy 'n' rows of data, and paste special transpose into another sheet but for each value to have one column between them ie Cells A2, a3, a4....to be copied into a1, c1, e1 etc of sheet two. The number of rows will be unknown each time so the 'copy' code will incorporate 'xldown' and the paste is each column until all data is copied. Presumably a loop to work down the rows until a blank value is found and a copy function that offsets one column for each 'I' for 'I to n'

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA code to copy n rows of data and paste into every second column

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    08-14-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA code to copy n rows of data and paste into every second column

    thanks. the code you suggested worked in the main but for some reason only copied the first 50 odd observations not the entire dataset. I was able to solve the problem using alternative code. thanks again for your input

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA code to copy n rows of data and paste into every second column

    You're welcome
    Can you attach your code that worked for you?

    It is better to upload sample of your workbook..
    Regards

+ 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] VBA code: copy/paste data from 2 two columns into one column
    By Tapyr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-23-2015, 07:19 AM
  2. [SOLVED] Need to copy and paste from several rows instead of just one based on column data
    By AWITCHER in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2015, 03:49 PM
  3. Replies: 3
    Last Post: 10-23-2014, 01:58 PM
  4. [SOLVED] Need VBA Macro to Copy and paste column data in blank rows and repeat through spreadsheet
    By slk1186 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-07-2014, 12:50 PM
  5. VBA Code to copy data from last filled column and paste to the next available column.
    By Pavman2473 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2012, 09:07 PM
  6. Code to copy data from one column and paste in at the bottom of another list
    By Winon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2011, 10:20 PM
  7. Copy Column Data and Paste Into Rows
    By moongate in forum Excel General
    Replies: 3
    Last Post: 12-11-2008, 07:51 PM

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