Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating new worksheets and appending data from multiple worksheets. | Excel Programming | |||
Compare Rows on different Worksheets and Output Difference's to other Worksheets. | Excel Programming | |||
How use info in Excel shared worksheets to create new worksheets | Excel Worksheet Functions | |||
VBA / Macro for creating new worksheets and new columns from existing worksheets | Excel Programming | |||
Need code to protect worksheets - amount of worksheets varies | Excel Programming |