#1   Report Post  
Posted to microsoft.public.excel.programming
MB1 MB1 is offline
external usenet poster
 
Posts: 1
Default Worksheets

I'm new to VBA and programming, so be gentle!

I am trying to get a match for a string on one of my worksheets. With
the example below if the BTRT Winter 0809 sheet is manually
preselected then the statement works fine, however if another sheet
has been selected it doesn't work. Also if I use:
Workbooks("TaxCalculator").Worksheets(btrt).Activa te prior to the
statement it also works.

Dim btrt As String
btrt = "BTRT Winter 0809"

logBookArray(3) =
Workbooks("TaxCalculator").Worksheets(btrt).Applic ation.Match(logBookArray(1)
& logBookArray(2) & "346 ", Range("A1:A200"), 0) '.Offset(0, 1).Value

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Worksheets

I'd try qualifying the Range("A1:A200") to make sure it referred to the sheet
you want.

Should it be:
Workbooks("TaxCalculator").Worksheets(btrt).Range( "A1:A200")
????

On 12/15/2010 04:38, MB1 wrote:
I'm new to VBA and programming, so be gentle!

I am trying to get a match for a string on one of my worksheets. With
the example below if the BTRT Winter 0809 sheet is manually
preselected then the statement works fine, however if another sheet
has been selected it doesn't work. Also if I use:
Workbooks("TaxCalculator").Worksheets(btrt).Activa te prior to the
statement it also works.

Dim btrt As String
btrt = "BTRT Winter 0809"

logBookArray(3) =
Workbooks("TaxCalculator").Worksheets(btrt).Applic ation.Match(logBookArray(1)
& logBookArray(2)& "346 ", Range("A1:A200"), 0) '.Offset(0, 1).Value

Any ideas?


--
Dave Peterson
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
Creating new worksheets and appending data from multiple worksheets. Dow Excel Programming 5 March 11th 08 07:04 PM
Compare Rows on different Worksheets and Output Difference's to other Worksheets. [email protected] Excel Programming 3 September 19th 07 04:48 PM
How use info in Excel shared worksheets to create new worksheets dkc Excel Worksheet Functions 0 June 28th 07 08:36 PM
VBA / Macro for creating new worksheets and new columns from existing worksheets webby2006 Excel Programming 3 July 25th 06 03:38 PM
Need code to protect worksheets - amount of worksheets varies Sandy[_3_] Excel Programming 1 September 9th 03 02:17 AM


All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"