ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   My first macro - doesnt work - function not recognised (https://www.excelbanter.com/excel-worksheet-functions/88544-my-first-macro-doesnt-work-function-not-recognised.html)

James Cornthwaite

My first macro - doesnt work - function not recognised
 
I have written my own function FindNominal (as below) in a macro in excel. I
want to use this function repeatedly in my excel spreadsheet.


Function FindNominal(NomCode)

FindNominal = Vlookup(NomCode, IMPORTDOC, 5 false)
End Function


but it does NOT work.


It reports
Vlookup is not recognised.
Do i need to write an import statement?

IMPORTDOC is defined as a range of cells in excel by the name, define
command.
I take it this is acceptable?

Thanks




Don Guillett

My first macro - doesnt work - function not recognised
 
Please decide where you want to post

--
Don Guillett
SalesAid Software

"James Cornthwaite" wrote in message
...
I have written my own function FindNominal (as below) in a macro in excel.
I
want to use this function repeatedly in my excel spreadsheet.


Function FindNominal(NomCode)

FindNominal = Vlookup(NomCode, IMPORTDOC, 5 false)
End Function


but it does NOT work.


It reports
Vlookup is not recognised.
Do i need to write an import statement?

IMPORTDOC is defined as a range of cells in excel by the name, define
command.
I take it this is acceptable?

Thanks






DJH

My first macro - doesnt work - function not recognised
 
Function FindNominal(NomCode)

FindNominal = WorksheetFunction.VLookup(NomCode, Range("IMPORTDOC"), 5,
False)
End Function


"James Cornthwaite" wrote in message
...
I have written my own function FindNominal (as below) in a macro in excel.
I
want to use this function repeatedly in my excel spreadsheet.


Function FindNominal(NomCode)

FindNominal = Vlookup(NomCode, IMPORTDOC, 5 false)
End Function


but it does NOT work.


It reports
Vlookup is not recognised.
Do i need to write an import statement?

IMPORTDOC is defined as a range of cells in excel by the name, define
command.
I take it this is acceptable?

Thanks







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

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