![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Location: Texas Instruments
Posts: 47
|
I get an error when I try to use MATCH from the immediate window:
?Application.WorksheetFunction.Match(0.2,A1:A10,1) A1:A10 contains a sequential range of numbers from -.2 to 0.5 . I get a compile error "Expected list separator or )". From Excel help, this seems to be the correct syntax. What am I missing? |
|
|
|
|
|
#2 |
|
New Member
Join Date: Feb 2002
Location: Texas Instruments
Posts: 47
|
It seems that the help examples only work on a spreadsheet, not from VBA. VBA requires a range.This works:
?Application.WorksheetFunction.Match(0.2,Worksheets("Sheet1").range("A1:A10"),1) 5 |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Change that to
Application.Match(0.2,Range("A1:A10"),1) It's a little more reliable than using the WorksheetFunction |
|
|
|
#4 |
|
Board Regular
Join Date: May 2002
Posts: 541
|
You can also fix the problem by changing your quotations to brackets:
Application.Match(0.2, [A1:B10], 0) |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|