ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with this macrosheet (https://www.excelbanter.com/excel-programming/347051-help-macrosheet.html)

Vince

Help with this macrosheet
 
Sub Macro1()

Dim wshO As Worksheet, rgO As Range '(O)rigin sheet and range
Dim wshD As Worksheet, rgD As Range '(D)estination sheet and range
Set wshO = ThisWorkbook.Worksheets("Murk 11A") 'origin sheet
Set rgO = wshO.Range("A1") 'origin range
Set rgD = wshD.Range("O38") 'Destination range
Set wshD = ThisWorkbook.Worksheets("Murk 11A") 'dest sheet
'Find last cell on dest range using column O.
'--- Copy Murk 11A!A1:O38 at end of data in "Murk 11A" ---


Set wshO = ThisWorkbook.Worksheets("T+M") 'origin sheet
Set rgO = wshO.Range("A1") 'origin range
Set rgD = wshD.Range("w89") 'Destination range
Set wshD = ThisWorkbook.Worksheets("T+M") 'dest sheet
'Find last cell on dest range using column W.
'--- Copy T+M!A1:W89 at end of data in "T+M" ---


Set wshO = ThisWorkbook.Worksheets("Murk 12C") 'origin sheet
Set rgO = wshO.Range("A1") 'origin range
Set rgD = wshD.Range("Q41") 'Destination range
Set wshD = ThisWorkbook.Worksheets("Murk 12C") 'dest sheet
'Find last cell on dest range using column Q.
'--- Copy Murk 12C!A1:Q41 at end of data in "Murk 12C" ---

Set rgD = wshO.Columns(1).Cells(wshO.Columns(1).Cells.Count) 'last cell
in col A: A65536.
Set rgD = rgD.End(xlUp).Offset(1, 0) 'last cell of data in A then 1 row
bellow.

'Now copy/paste
rgO.Copy rgD 'Syntax: OriginRange.Copy DestinationRange

'--- repeat above section ---
End Sub





All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com