Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a .Range to equal another .Range
On Sheet1,
A1 = One B1 = Two What is the proper code to set ... Sheet2.Range("A1:B1") to be equal to Sheet1.Range("A1:B1") , so that on Sheet2 A1 = One B1 = Two - Ronald K. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a .Range to equal another .Range
hi Ronald,
Sheets("Feuil2").Range("A1:B1") = Sheets("Feuil1").Range("A1:B1").Value -- isabelle |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a .Range to equal another .Range
"kittronald" wrote:
On Sheet1, A1 = One B1 = Two What is the proper code to set ... Sheet2.Range("A1:B1") to be equal to Sheet1.Range("A1:B1") , so that on Sheet2 A1 = One B1 = Two Assuming that Sheet1 and Sheet2 are Worksheets variables that you set as follows: Set Sheet1 = Sheets("sheet1") Set Sheet2 = Sheets("sheet2") you would think the following would suffice since .Value is the default member for Range variables: Sheet2.Range("a1:b1") = Sheet1.Range("a1:b1") But for reasons I cannot explain, statements of that form require .Value written explicitly at least on the right-hand side, to wit: Sheet2.Range("a1:b1") = Sheet1.Range("a1:b1").Value |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a .Range to equal another .Range
On Oct 17, 4:51*pm, "kittronald" wrote:
* * On Sheet1, * * * * A1 = One * * * * B1 = Two * * What is the proper code to set ... * * * * Sheet2.Range("A1:B1") * * to be equal to Sheet1.Range("A1:B1") , so that on Sheet2 * * * * A1 = One * * * * B1 = Two - Ronald K. simply put in sheet 2 in cell a1 put =sheet1!a1 in cell b1 put =sheet1!b1 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a .Range to equal another .Range
Isabelle,
Drat ! Just missing the ".Value" at the end. Merci beaucoup ! - Ronald K. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a .Range to equal another .Range
I was thinking the same thing and left off ".Value".
Adding ".Value" fixed the problem. Thanks for the quick response. - Ronald K. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SUMPRODUCT or SUMIF if any values in a range equal any values in another range | Excel Worksheet Functions | |||
Setting a range.value equal to /part/ of a (3D) variant array? | Excel Programming | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
setting range().hidden=True causes range error 1004 | Excel Programming | |||
setting a range variable equal to the value of a string variable | Excel Programming |