Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using sheet codename problems

I'm having problems with the way I access sheets of the
ActiveWorkbook from an addin. Basically, I need to
rewrite the following line of code (simplified for this
example) to use the sheet's codename (SamplePrep) instead
of the sheet's position in the Sheets collection (sheets
(1)):

vResult = ActiveWorkbook.Sheets(1).Range("A:A").Find
(iSearchValue).Offset(0,2).Value

to something like this:

vResult = ActiveWorkbook.SamplePrep.Range("A:A").Find
(iSearchValue).Offset(0,2).Value

Any ideas or suggestions would be *greatly* appreciated.

Thanks in advance,
Dustin Carter
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Using sheet codename problems

Dustin,

The codename should not be qualified:

vResult = SamplePrep.Range("A:A").Find

--

John Green - Excel MVP
Sydney
Australia


"Dustin Carter" wrote in message ...
I'm having problems with the way I access sheets of the
ActiveWorkbook from an addin. Basically, I need to
rewrite the following line of code (simplified for this
example) to use the sheet's codename (SamplePrep) instead
of the sheet's position in the Sheets collection (sheets
(1)):

vResult = ActiveWorkbook.Sheets(1).Range("A:A").Find
(iSearchValue).Offset(0,2).Value

to something like this:

vResult = ActiveWorkbook.SamplePrep.Range("A:A").Find
(iSearchValue).Offset(0,2).Value

Any ideas or suggestions would be *greatly* appreciated.

Thanks in advance,
Dustin Carter



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
string to codename rk0909 Excel Discussion (Misc queries) 4 September 25th 08 10:57 PM
Referencing worksheet CODENAME in a chart object. Bing Excel Discussion (Misc queries) 1 February 15th 05 01:01 AM
Worksheet codename Andy Excel Programming 4 December 2nd 03 04:12 PM
How do I determine the Acrobat Distiller codename? Jeremy Gollehon[_2_] Excel Programming 2 October 14th 03 10:13 PM
Codename equivalent for Series Sandy V Excel Programming 3 August 25th 03 10:59 PM


All times are GMT +1. The time now is 03:30 PM.

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"