Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple question: copy/paste column
Hi, I have a simple question that I cannot find an answer to:
I have two Range variables, which are columns. I'd like to copy them and paste them on to a new worksheet... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple question: copy/paste column
Hi H,
Try something like: '============= Public Sub Tester1() Dim WB As Workbook Dim srcSH As Worksheet Dim destSH As Worksheet Dim srcRng As Range Dim destRng As Range Set WB = Workbooks("MyBook.xls") '<<==== CHANGE With WB Set srcSH = .Sheets("Sheet2") '<<==== CHANGE Set destSH = .Sheets("Sheet3") '<<==== CHANGE End With With srcSH Set srcRng = Union(.Columns("A:A"), .Columns("C:C")) End With Set destRng = destSH.Range("A1") srcRng.Copy Destination:=destRng End Sub '<<============= --- Regards, Norman "hfazal" wrote in message ... Hi, I have a simple question that I cannot find an answer to: I have two Range variables, which are columns. I'd like to copy them and paste them on to a new worksheet... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple question: copy/paste column
Dim r1 as Range, r2 as Range
With ActiveSheet set r1 = .Columns(1) set r2 = .columns(9) End With r1.copy worksheets("Sheet2").Range("B1") r2.copy worksheets("Sheet2").Range("F1) -- regards, Tom Ogilvy "hfazal" wrote: Hi, I have a simple question that I cannot find an answer to: I have two Range variables, which are columns. I'd like to copy them and paste them on to a new worksheet... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Line copy - Not just a simple copy paste | Excel Worksheet Functions | |||
Simple Copy/Paste Question | Excel Programming | |||
Simple Paste Question | Excel Programming | |||
Simple Copy & Paste | Excel Programming | |||
Simple copy paste question | Excel Programming |