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... |
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... |
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... |
All times are GMT +1. The time now is 02:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com