Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to use MATCH with a vector in VBA?

Hello

I like to call the worksheetfunction MATCH in VBA. I am using the
formula
=MATCH(2;1/(2:2<"")) for getting the last used column. How do I
programm that with VBA?

Application.WorksheetFunction.Match( ... ???? )

Thanks for any hints and examples

regards
Mark

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to use MATCH with a vector in VBA?

I'd use something like:

Option Explicit
Sub testme()
Dim myFormula As String
Dim myRng As Range
Dim res As Variant

With ActiveSheet
Set myRng = .Rows(2)

myFormula = "=Match(2,1/(" & _
(myRng.Address(external:=True) & "<""""))")

res = Evaluate(myFormula)
If IsError(res) Then
MsgBox "error"
Else
MsgBox res
End If
End With

End Sub

joes wrote:

Hello

I like to call the worksheetfunction MATCH in VBA. I am using the
formula
=MATCH(2;1/(2:2<"")) for getting the last used column. How do I
programm that with VBA?

Application.WorksheetFunction.Match( ... ???? )

Thanks for any hints and examples

regards
Mark


--

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
How can I plot a 3-D vector in Excel? wknehans Charts and Charting in Excel 2 July 7th 06 08:18 PM
How do I draw 3D vector arithmetic, showing vector subtraction? Colin Kemp Excel Discussion (Misc queries) 0 April 5th 06 07:30 AM
Insert row for each different value in a vector Alex St-Pierre Excel Programming 1 February 23rd 06 08:41 PM
from table to vector PierreL Excel Worksheet Functions 6 November 25th 04 01:03 AM
Vector lookup function GregTh Excel Worksheet Functions 1 November 4th 04 08:34 PM


All times are GMT +1. The time now is 11:17 AM.

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"