Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Line copy - Not just a simple copy paste Ninerref Excel Worksheet Functions 3 September 10th 09 11:44 AM
Simple Copy/Paste Question Dan R. Excel Programming 5 January 31st 07 05:58 PM
Simple Paste Question shawn Excel Programming 2 September 23rd 04 02:40 PM
Simple Copy & Paste Bob Barnes[_3_] Excel Programming 3 February 20th 04 11:09 PM
Simple copy paste question Z[_2_] Excel Programming 3 February 5th 04 09:03 PM


All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"