![]() |
VB Excel syntax for "offset" statement
Hi, I've been trying without success to figure out how to do this: I
have an OFFSET statement containing a reference to a different sheet, and I cannot get it to work. It would have to be something like OFFSET( worksheet3!lines, 5). I cannot write the "worksheet3!lines" reference in a way that will work. Can someone please point out how to do this? Many thanks. |
VB Excel syntax for "offset" statement
You can't OFFSET over different worksheets, if that's what you are trying to
do. Is "lines" a named range on worksheet3 ? Does this what you need ? worksheet3.Range("lines").Offset(0,5)... NickHK wrote in message ups.com... Hi, I've been trying without success to figure out how to do this: I have an OFFSET statement containing a reference to a different sheet, and I cannot get it to work. It would have to be something like OFFSET( worksheet3!lines, 5). I cannot write the "worksheet3!lines" reference in a way that will work. Can someone please point out how to do this? Many thanks. |
VB Excel syntax for "offset" statement
The Range statement also allows the sheet reference to be embedded in the
string Range("Sheet1!a3").Value = Range("Sheet2!a1").Offset(1, 1).Value (note that you will need to enclose the sheet name in apostrophes if it contains spaces or special character: e.g. "'Sheet Name'!A1") "NickHK" wrote: You can't OFFSET over different worksheets, if that's what you are trying to do. Is "lines" a named range on worksheet3 ? Does this what you need ? worksheet3.Range("lines").Offset(0,5)... NickHK wrote in message ups.com... Hi, I've been trying without success to figure out how to do this: I have an OFFSET statement containing a reference to a different sheet, and I cannot get it to work. It would have to be something like OFFSET( worksheet3!lines, 5). I cannot write the "worksheet3!lines" reference in a way that will work. Can someone please point out how to do this? Many thanks. |
VB Excel syntax for "offset" statement
Charlie wrote: The Range statement also allows the sheet reference to be embedded in the string Range("Sheet1!a3").Value = Range("Sheet2!a1").Offset(1, 1).Value (note that you will need to enclose the sheet name in apostrophes if it contains spaces or special character: e.g. "'Sheet Name'!A1") "NickHK" wrote: You can't OFFSET over different worksheets, if that's what you are trying to do. Is "lines" a named range on worksheet3 ? Does this what you need ? worksheet3.Range("lines").Offset(0,5)... NickHK Many thanks to everyone who replied. |
VB Excel syntax for "offset" statement
NickHK wrote: You can't OFFSET over different worksheets, if that's what you are trying to do. Is "lines" a named range on worksheet3 ? Does this what you need ? worksheet3.Range("lines").Offset(0,5)... As I have it, "lines" is just a name assigned a number in worksheet3. Say "lines" is 3. Then I want the statement OFFSET ("lines",4) to mean OFFSET(3,4). I just can't come up with the correct syntax for the "lines" argument. Thanks for your help. |
All times are GMT +1. The time now is 05:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com