Copy data from one tab to another.

philb99

Active Member
Joined
Feb 3, 2014
Messages
426
Office Version
  1. 2013
Platform
  1. Windows
Hi

I have MI recorded on one tab going left to right and I wish to show this in table formats going down on tab 2

Looking for help on how best to achieve please

Thanks

 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try:
VBA Code:
Sub CopyData()
    Application.ScreenUpdating = False
    Dim srcWS As Worksheet, desWS As Worksheet, lRow As Long
    Set srcWS = Sheets("Sheet1")
    Set desWS = Sheets("Sheet2")
    With desWS
        srcWS.Range("A2").Copy .Range("A2")
        .Range("A2:B2").Merge
        .Range("A2:B2").WrapText = True
        .Rows(2).RowHeight = 30
        srcWS.Range("B1:Q1").Copy
        .Range("A3").PasteSpecial Transpose:=True
        srcWS.Range("B2:Q2").Copy
        .Range("B3").PasteSpecial Transpose:=True
        .Range("A2", .Range("A" & .Rows.Count).End(xlUp)).SpecialCells(xlBlanks).EntireRow.Delete
        lRow = .Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
        .Range("A" & lRow + 1) = "Total"
        .Range("B" & lRow + 1).Formula = "=sum(B3:B" & lRow & ")"
    End With
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top