ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A little help vidth a Function (https://www.excelbanter.com/excel-programming/378652-little-help-vidth-function.html)

excelent

A little help vidth a Function
 
I made this function and it works fine
xDate is 1 cell vith a date, xRange is a range vith som difrent dates

Function Vagt(xDate, xRange)
Vagt = Application.WorksheetFunction.Match(Range(xDate), Range(xRange))
End Function

The problem is that i have to use "" to make the function work

=Vagt("L3";"A3:A9";0)

Hav do i change my function so i dont have to use ""

=Vagt(L3;A3:A9;0)

thanks in advance

Niek Otten

A little help vidth a Function
 
Function Vagt(xDate as Range, xRange as Range)
Vagt = Application.WorksheetFunction.Match(xDate, xRange)
End Function

BTW:

=Vagt(L3;A3:A9;0) Should give an error, because the number of arguments is incorrect.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"excelent" wrote in message ...
|I made this function and it works fine
| xDate is 1 cell vith a date, xRange is a range vith som difrent dates
|
| Function Vagt(xDate, xRange)
| Vagt = Application.WorksheetFunction.Match(Range(xDate), Range(xRange))
| End Function
|
| The problem is that i have to use "" to make the function work
|
| =Vagt("L3";"A3:A9";0)
|
| Hav do i change my function so i dont have to use ""
|
| =Vagt(L3;A3:A9;0)
|
| thanks in advance



excelent

A little help vidth a Function
 
Hi Niek it works great now
y i wrote =Vagt("L3";"A3:A9";0) my mistake

i realy use =Vagt("L3";"A3:A9")

but anyway u made my day :-) thanks alot



"Niek Otten" skrev:

Function Vagt(xDate as Range, xRange as Range)
Vagt = Application.WorksheetFunction.Match(xDate, xRange)
End Function

BTW:

=Vagt(L3;A3:A9;0) Should give an error, because the number of arguments is incorrect.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"excelent" wrote in message ...
|I made this function and it works fine
| xDate is 1 cell vith a date, xRange is a range vith som difrent dates
|
| Function Vagt(xDate, xRange)
| Vagt = Application.WorksheetFunction.Match(Range(xDate), Range(xRange))
| End Function
|
| The problem is that i have to use "" to make the function work
|
| =Vagt("L3";"A3:A9";0)
|
| Hav do i change my function so i dont have to use ""
|
| =Vagt(L3;A3:A9;0)
|
| thanks in advance





All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com