Splite the multiple column value copy & paste in other sheet
Solved/Closed
Nitesh2020
Posts
1
Registration date
Thursday December 31, 2020
Status
Member
Last seen
December 31, 2020
-
Dec 31, 2020 at 12:52 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jan 5, 2021 at 12:20 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jan 5, 2021 at 12:20 PM
Related:
- Vba code to delete multiple columns based on header
- How to delete multiple files on mac - Guide
- Battery reset code - Guide
- Samsung volume increase code - Guide
- How to get whatsapp verification code online - Guide
- Cs 1.6 code - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jan 5, 2021 at 12:20 PM
Jan 5, 2021 at 12:20 PM
Hi Nitesh,
Create your destination sheet, call it "Sheet2" and add the header in range B1:W1.
Then run the following code:
Best regards,
Trowa
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