Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
in Office VB code:
what does the operator ":=" mean? example: Worksheets("Daily Targets").Range("A5:N5").Copy _ Destination:=Worksheets("Daily Targets").Range("A" & CStr(rowCounter)) i wrote this code but i copied the it from the HELP, & then i changed the names & variables. BUT, i'd like to understand what does the operator := is filling for, is it an object assigning or what ... i'm not sure ??!!! regards, Michael |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Probably the easiest way to explain it is that the colon (:) tells VBA that
it is not assigninng a variable. In other words if you entered this statement: Destination = Range("A1") , then VBA would treat Destination as a variable and unless you put Set in front of Destination it would give you an error message. But with the colon and equal sign (:=) VBA knows that Destination is a parameter of the Copy and Paste method and not a variable assignment. "Michael/what does the operator ":=" mean" wrote: in Office VB code: what does the operator ":=" mean? example: Worksheets("Daily Targets").Range("A5:N5").Copy _ Destination:=Worksheets("Daily Targets").Range("A" & CStr(rowCounter)) i wrote this code but i copied the it from the HELP, & then i changed the names & variables. BUT, i'd like to understand what does the operator := is filling for, is it an object assigning or what ... i'm not sure ??!!! regards, Michael |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
It's the syntax for named arguments. From help file: A named argument consists of an argument name followed by a colon and an equal sign (:=), followed by the argument value. For more details search help using "Understanding Named and Optional Arguments" Cheers Andy Michael/what does the operator := mean wrote: in Office VB code: what does the operator ":=" mean? example: Worksheets("Daily Targets").Range("A5:N5").Copy _ Destination:=Worksheets("Daily Targets").Range("A" & CStr(rowCounter)) i wrote this code but i copied the it from the HELP, & then i changed the names & variables. BUT, i'd like to understand what does the operator := is filling for, is it an object assigning or what ... i'm not sure ??!!! regards, Michael -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just to confuse matters further. Using named arguments allows you to just
enter the non-default arguments for a command and enter them in any order rather than having to enter something for every possible argument and to have to do it in a particular order. The := tells the VBA engine that what follows is a value to be used as the specific argument indicated by the entry on the left side of the := indicator. "Michael/what does the operator ":=" mean" wrote: in Office VB code: what does the operator ":=" mean? example: Worksheets("Daily Targets").Range("A5:N5").Copy _ Destination:=Worksheets("Daily Targets").Range("A" & CStr(rowCounter)) i wrote this code but i copied the it from the HELP, & then i changed the names & variables. BUT, i'd like to understand what does the operator := is filling for, is it an object assigning or what ... i'm not sure ??!!! regards, Michael |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Text "comparison" operator for "contains" used in an "IF" Function | Excel Worksheet Functions | |||
Is it possible to apply IF's to "operator" result.. | Excel Discussion (Misc queries) | |||
program stuck at "Save Cancelled by Operator" | Excel Discussion (Misc queries) | |||
How 2 use right shift "<<" and left shift "" operator in excel? | Excel Programming | |||
Excel no longer allows new formulas with division "/" operator | Excel Programming |