[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Re: Sheet referencing in a macro

Nick Hodge

12/18/2006 9:39:00 PM

Lou

Use the index

Worksheets(1)
Worksheets(2)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
www.nickhodge.co.uk


"LouP" <LouP@discussions.microsoft.com> wrote in message
news:7850A8B2-8E15-4AF1-A2F1-F08439F30B09@microsoft.com...
>I am trying to write a macro that always references the first two sheets
>and
> I am adding new sheets daily to the workbook. I am naming the sheets with
> the date they were added to the workbook. Is there a way to reference the
> sheets that are always on the first two tabs? Remember that new tabs are
> being added daily and I can't use Sheet1 as the newest sheet is given the
> last number regardless of the tab order.
>
> Lou

2 Answers

Lou P

12/19/2006 9:41:00 PM

0

Hi Nick,

Thanks for responding. Please see my further explanation below. Let me
know if what I am trying to do is still not clear.

Thanks Again,
Lou

"Nick Hodge" wrote:

> Lou
>
> Use the index
>
> Worksheets(1)
> Worksheets(2)
>
> --
> HTH
> Nick Hodge
> Microsoft MVP - Excel
> Southampton, England
> nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
> www.nickhodge.co.uk
>
>
> "LouP" <LouP@discussions.microsoft.com> wrote in message
> news:7850A8B2-8E15-4AF1-A2F1-F08439F30B09@microsoft.com...
> >I am trying to write a macro that always references the first two sheets
> >and
> > I am adding new sheets daily to the workbook. I am naming the sheets with
> > the date they were added to the workbook. Is there a way to reference the
> > sheets that are always on the first two tabs? Remember that new tabs are
> > being added daily and I can't use Sheet1 as the newest sheet is given the
> > last number regardless of the tab order.
> >
> > Lou
>

Nick Hodge

12/19/2006 11:16:00 PM

0

Lou

What is wrong with the solution I gave? This will always reference the two
far-left sheets

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
www.nickhodge.co.uk


"LouP" <LouP@discussions.microsoft.com> wrote in message
news:436CA6A9-A459-495D-84A1-333DC44947A3@microsoft.com...
> Hi Nick,
>
> Thanks for responding. Please see my further explanation below. Let me
> know if what I am trying to do is still not clear.
>
> Thanks Again,
> Lou
>
> "Nick Hodge" wrote:
>
>> Lou
>>
>> Use the index
>>
>> Worksheets(1)
>> Worksheets(2)
>>
>> --
>> HTH
>> Nick Hodge
>> Microsoft MVP - Excel
>> Southampton, England
>> nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
>> www.nickhodge.co.uk
>>
>>
>> "LouP" <LouP@discussions.microsoft.com> wrote in message
>> news:7850A8B2-8E15-4AF1-A2F1-F08439F30B09@microsoft.com...
>> >I am trying to write a macro that always references the first two sheets
>> >and
>> > I am adding new sheets daily to the workbook. I am naming the sheets
>> > with
>> > the date they were added to the workbook. Is there a way to reference
>> > the
>> > sheets that are always on the first two tabs? Remember that new tabs
>> > are
>> > being added daily and I can't use Sheet1 as the newest sheet is given
>> > the
>> > last number regardless of the tab order.
>> >
>> > Lou
>>