+ Reply to Thread
Results 1 to 4 of 4

Trying to copy data from sheet1 vertical to sheet3 horizontally

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    209

    Trying to copy data from sheet1 vertical to sheet3 horizontally

    Hello i am trying to copy the data in a named range that is vertically entered so Sheet1 "F10" has the 1st piece of data Sheet 1 "F11 has the next. Finally ending in Sheet1 "g17" then some more data in J10 to K15 i have named these CustomerData for (F10 to G17) and ProductData for (J10 to K15) and Fault Found (N10) all this data to be pasted into sheet("Data")

    I have in sheet3 or Sheets"Data" the same information but stored horizontally

    I have tried a few different ways of coding this with various errors

    Sub GetData()
        With Sheets("Data")
            Sheet1.Range("CustomerData, ProductData, FaultReported").Copy
            .Range("A" & .Cells(Rows.Count, 1).End(xlUp).Offset(1).Row).PasteSpecial xlPasteAll, , , True
            Application.CutCopyMode = False
        End With
    End Sub
    And tried

    Sub GetData()
        With Sheets("Sheet1")
            Sheet1.Range("CustomerData, ProductData, FaultReported").Copy
            Sheets("Data").Range("A" & .Cells(Rows.Count, 1).End(xlUp).Offset(1).Row).PasteSpecial xlPasteAll, , , True
            Application.CutCopyMode = False
        End With
    End Sub
    Error is Method 'range' of object '_Worksheet' failed

    Thank you for your help
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Trying to copy data from sheet1 vertical to sheet3 horizontally

    Type copy/paste transpose?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    209

    Re: Trying to copy data from sheet1 vertical to sheet3 horizontally

    tried below but same error

    
    Sub GetData()
        
       Worksheets("Sheet1").Range("CustomerData, ProductData, FaultReported").Copy
       Worksheets("Data").Range("AllData").PasteSpecial Transpose:=True
       
    End Sub

  4. #4
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    209

    Re: Trying to copy data from sheet1 vertical to sheet3 horizontally

    I noticed that with this method when we paste it will still put the blank rows in-between?

    Will have to ponder that 1 as when multiple results on sheet2 you would them together.

    1-123
    1-235

    not
    1-123

    1-235

    As it goes throught the data to paste on the next available line in sheet 2 not have the space between the rows pasted as well.

    You have given me lots to ponder on

+ 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. copy sheet 2 data as it is in sheet3 if column "B" matches in sheet1 & Sheet2
    By shloksurya in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2015, 09:35 PM
  2. [SOLVED] Copy Range of data from sheet1 and sheet2 paste it in sheet3
    By hassan khansa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2013, 05:55 AM
  3. Copy Range of data from sheet1 and sheet2 paste it in sheet3
    By hassan khansa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 05:47 AM
  4. [SOLVED] copy and paste from sheet1 and sheet2 to sheet3 and loop
    By sagroy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-07-2013, 02:04 PM
  5. [SOLVED] copy details in sheet3,d8 into sheet1,e10. there are 48 sheet.
    By sand takagi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2012, 12:33 PM
  6. Replies: 5
    Last Post: 08-29-2012, 03:08 AM
  7. How to copy some columns from sheet1 to sheet2 or sheet3
    By wlarson in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-30-2007, 08:58 AM

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