LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Syntax question using :=

Hello,
In using the range method "copy" I have run into some issues with
syntax. Below is some code. I have three statements for copying the
range to a specified destination. Two methods work. But when I use
parentheses around the argument, I get an error. I've encountered
this before. Why would I get an error when putting the argument in
parentheses?

Sub Copy_Ranges()

Dim source_range As Range
Dim dest_location As Range

Set source_range = Worksheets("Sheet1").Range("A1:B2")
Set dest_location = Worksheets("Sheet1").Range("A10")

source_range.Copy Destination dest_location ' this works fine
source_range.Copy Destination:=dest_location ' this works fine
source_range.Copy(dest_location) ' this one
results in an error

End Sub
 
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
Syntax question BigDave63 Excel Worksheet Functions 4 February 5th 09 06:50 PM
syntax question Gary Keramidas Excel Programming 10 March 4th 07 09:53 PM
syntax question JT Excel Programming 1 November 28th 05 08:41 PM
Syntax question Stuart[_5_] Excel Programming 3 December 3rd 03 08:45 PM
VBA Syntax Question? Michael168[_54_] Excel Programming 0 November 5th 03 11:02 AM


All times are GMT +1. The time now is 06:27 AM.

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

About Us

"It's about Microsoft Excel"