+ Reply to Thread
Results 1 to 7 of 7

VBA to copy from one tab to another

  1. #1
    Registered User
    Join Date
    11-14-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    18

    VBA to copy from one tab to another

    Hi

    I have a file which contains 2 tabs. The first tab (called "data") has 6 columns and 3 rows on it.

    Row Number Date Name Type Value VAT
    1 1 01/04/2015 ABC Limited Invoice 2,400 400
    2 2 10/04/2015 DEF Limited Invoice 1,200 200
    3 3 01/05/2015 JKL Limited Invoice 2,100 350

    I want to transpose this data onto the second tab (called "result") however the structure in tab 2 (called "result") should be as follows:

    Row No Column A Column B Column C Column D Column E
    1 1 01/04/2015 ABC Limited
    2 Invoice 2,400 400
    3 2 10/04/2015 DEF Limited
    4 Invoice 1,200 200
    5 3 01/05/2015 JKL Limited
    6 Invoice 2,100 350

    The data on the first tab (called "data") can be any number of rows hence dynamic.

    Can someone please help with a VB code which can transpose data from the first tab (called "data") to the second tab (called "result") on the above format? I am using Excel 2010.

    Any help would be appreciated.

    Regards

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: VBA to copy from one tab to another

    Attach a sample workbook. 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 use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Registered User
    Join Date
    11-14-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    18

    Re: VBA to copy from one tab to another

    Image to assist with question

    Untitled.png

  4. #4
    Registered User
    Join Date
    11-14-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    18

    Re: VBA to copy from one tab to another

    File as requested attached

    Book.xlsx

  5. #5
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: VBA to copy from one tab to another

    Here you go.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-14-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    18

    Re: VBA to copy from one tab to another

    Thank you for your help. Works perfectly. I have a follow on request and would appreciate your assistance please.

    Is there a way that I can manually allocate cells in sheet 1 to sheet 2 in the VBA code instead of select first 3 copy and paste with offset? So something like sheet 1 column A needs to be pasted to sheet 2 column D and so on...

    The reason I ask is that sheet 2 is a batch input sheet and will have blank columns for data that I don't need to upload.

    Thanks in advance.

  7. #7
    Registered User
    Join Date
    11-14-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    18

    Re: VBA to copy from one tab to another

    I have attached a file for what the data looks like and how I would like for it to be transposed.

    VBA File.xlsx

    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] Change Copy to Copy & Mirror Image the Copy
    By mills49 in forum Excel General
    Replies: 5
    Last Post: 08-21-2014, 05:25 AM
  2. Alter existing formula to copy specific cells in row instead of copy entire column
    By painterartist in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-02-2014, 12:42 PM
  3. [SOLVED] Macro to copy cell width to new sheets (ie copy original sheet format)
    By teenyjem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2013, 07:28 AM
  4. Save copy as, open copy, alter copy, save copy and close copy
    By tradinup2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-03-2013, 04:42 PM
  5. Macro to copy Dyanmic lists then copy sheet and clear the original data
    By twiggywales in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2012, 01:06 PM
  6. Copy one cell to an other but colors do not copy. While not using clipboard to copy.
    By chuckchuckit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2010, 03:08 AM
  7. [SOLVED] EXCEL FILE a copy/a copy/a copy ....filename
    By ve in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-29-2005, 05:05 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