Splite the multiple column value copy & paste in other sheet

Solved/Closed
Nitesh2020 Posts 1 Registration date Thursday 31 December 2020 Status Member Last seen 31 December 2020 - 31 Dec 2020 à 00:52
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 5 Jan 2021 à 12:20
Hello,
I want to copy & paste the value of my data sheet, value are save in column & row, i want to splite the spacific rage of column value copy & paste in other sheet in with same value as give example in image

thanks in advance for help i try to make macro but it not work for entire sheet


System Configuration: Windows / Chrome 87.0.4280.88

1 response

TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 555
5 Jan 2021 à 12:20
Hi Nitesh,

Create your destination sheet, call it "Sheet2" and add the header in range B1:W1.

Then run the following code:
Sub RunMe()
Dim x, sR, dR, sC, lRow As Long

Sheets("Sheet1").Select
lRow = Range("B" & Rows.Count).End(xlUp).Row
dR = 2

For sR = 2 To lRow
    x = 1
    sC = 24
    Range(Cells(sR, "B"), Cells(sR, "W")).Copy
    Sheets("Sheet2").Select
    Range(Cells(dR, "B"), Cells(dR + 6, "B")).Select
    Selection.PasteSpecial
    Sheets("Sheet1").Select
    Do
        Range(Cells(sR, sC), Cells(sR, sC + 10)).Copy Sheets("Sheet2").Range("K" & dR + x)
        x = x + 1
        sC = sC + 13
    Loop Until x = 7
    dR = dR + 7
Next sR
End Sub


Best regards,
Trowa