Utradeshow
Well-known Member
- Joined
- Apr 26, 2004
- Messages
- 802
- Office Version
- 365
I have code that copies columns from one sheet to another, but I need it to copy from other sheets as well.
I want to also copy Columns A, D, F from SHEET 3 and put in SHEET 1 COLUMN H, I, J
also copy Columns G, H, X from SHEET 4 and put in SHEET 1 COLUMN K, L, M.
I can't figure out how to add this, I looked at other examples but they are even more complex.
I want to also copy Columns A, D, F from SHEET 3 and put in SHEET 1 COLUMN H, I, J
also copy Columns G, H, X from SHEET 4 and put in SHEET 1 COLUMN K, L, M.
I can't figure out how to add this, I looked at other examples but they are even more complex.
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim src As Worksheet
Dim trg As Worksheet
Dim LastRow As Long
Set src = ThisWorkbook.Worksheets("SHEET 2")
Set trg = ThisWorkbook.Worksheets("SHEET 1")
src.Range("G:G").Copy Destination:=trg.Range("A1")
src.Range("D:D").Copy Destination:=trg.Range("B1")
src.Range("F:F").Copy Destination:=trg.Range("C1")
src.Range("H:H").Copy Destination:=trg.Range("D1")
src.Range("AA:AA").Copy Destination:=trg.Range("E1")
src.Range("AR:AR").Copy Destination:=trg.Range("F1")
src.Range("AS:AS").Copy Destination:=trg.Range("G1")