VBA to extract data from block info in a long row,and copy on another sheet non adjacent column

AndyJR

Board Regular
Joined
Jun 20, 2015
Messages
90
Hi all,

I know a lil bit excel, and i just started to learn VBA, need some help on creating this report.

In a worksheet "Hist" i have a 36 block of data located in a single row, each block use 12 column of data
block 1 = F4:Q4, (3 blanc column) then Block 2 = U4:AF4, then (3 blanc column) and Block 3.... and so on

what i need to achieve is :
extract block 1 (12 data column) and copy to worksheet "Report" but "non adjacent row", starting on
Code:
$B4:$Q4
extract block 2 (12 data column) and copy to worksheet "Report" but "non adjacent row", starting on
Code:
$U5:$AF5
extract block 3 (12 data column) and copy to worksheet "Report" but "non adjacent row", starting on
Code:
$AJ6:$AU6
extract block 4 (12 data column) and copy to worksheet "Report" but "non adjacent row", starting on
Code:
$AY7:$BJ7
And so on till reach the block 36



thank you in advance, Any help is appreciated !


Andyjr
 
Based on the illustration in post #10, maybe this is what you want.
Code:
Sub copyStuff5()
Dim sh1 As Worksheet, sh2 As Worksheet, i As Long, rw As Long, lc As Long
Set sh1 = Sheets("Hist")
Set sh2 = Sheets("Report")
lc = sh1.Cells(4, Columns.Count).End(xlToLeft).Column - 11
    rw = 4
    For i = 2 To lc Step 15
        sh1.Cells(4, i).Resize(1, 12).Copy sh2.Cells(rw, 2)
        rw = rw + 1
    Next
    For j = 23 To 3 Step -1
        Columns(j).Insert
    Next
End Sub
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,214,522
Messages
6,120,019
Members
448,938
Latest member
Aaliya13

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