brian_griffin
New Member
- Joined
- Oct 30, 2012
- Messages
- 7
Hello everyone,
I using a VBA code to copy cells from various excel sheets into one master sheet.
I have managed to employ VBA to copy single cells, but now I would like to copy a range of cells and transpose them into the master sheet.
However, I am not able to adapt the paste special command with the destination command.
My recent code is:
I would like to copy the cells H22 to H30 into the destination worksheet.
Has anyone any hint? I really appreciate any help.
Thanks in advance,
Brian
I using a VBA code to copy cells from various excel sheets into one master sheet.
I have managed to employ VBA to copy single cells, but now I would like to copy a range of cells and transpose them into the master sheet.
However, I am not able to adapt the paste special command with the destination command.
My recent code is:
Code:
Dim WBQ As Workbook
Dim WBZ As Workbook
Dim lngAnzahl As Long
Dim lngLastQ As Long
Set WBZ = ActiveWorkbook
...
Set WBQ = Workbooks.Open(Filename:=varDateien(lngAnzahl))
lngLastQ = WBQ.Worksheets(1).Range("A65536").End(xlUp).Row
WBQ.Worksheets(1).Range("H22").Copy _
Destination:=WBZ.Worksheets(1).Range("J" & WBZ.Worksheets(1).Range("J65536").End(xlUp).Row + 1)
WBQ.Close
I would like to copy the cells H22 to H30 into the destination worksheet.
Has anyone any hint? I really appreciate any help.
Thanks in advance,
Brian