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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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.

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
correct syntax for nesting "if", "and", and "vlookup"....if possib Christine Excel Worksheet Functions 4 January 2nd 09 10:43 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
How do I use "offset" function in "array formula"? hongguang Excel Discussion (Misc queries) 3 April 4th 07 12:04 AM
Syntax to "OR" 3 "ISERROR" conditions Mike K Excel Worksheet Functions 6 July 22nd 06 04:18 PM
what is syntax for if(between range of dates,"Q1","Q2")? TLB Excel Worksheet Functions 3 December 6th 05 05:19 PM


All times are GMT +1. The time now is 05:39 AM.

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"