Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
DLOOKUP AND VLOOKUP IN VBA
I wanted to search a value in my spreadsheet using VBA.
I tried to use VLOOKUP and DLOOKUP, but I got compile error "sub or function not defined" The code is like following code iStudent = DLOOKUP("[FIRST SEMI]", "NPARAMETER", "[SHEET NAME]" = "STUDENT NUMBER") iStudent = VLookup("STUDENT NUMBER", "NPARAMETER", False) Are there any other way to search a value from spreadsheet and return a value from other column? Any infromation is great appreciated, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
DLOOKUP AND VLOOKUP IN VBA
Hi Souris,
VLookup is an Excel worksheet function. To use it in VBA try: iStudent = Application,VLookup(...............) or iStudent= Application.WorksheetFunction.VLookup(............ ...) Many, but not all, worksheet functions are available to VBA. See WorksheetFunction in VBA help. For a list of functiona available to VBA, see: 'List of Worksheet Functions Available to Visual Basic' in VBA help. --- Regards, Norman "Souris" wrote in message ... I wanted to search a value in my spreadsheet using VBA. I tried to use VLOOKUP and DLOOKUP, but I got compile error "sub or function not defined" The code is like following code iStudent = DLOOKUP("[FIRST SEMI]", "NPARAMETER", "[SHEET NAME]" = "STUDENT NUMBER") iStudent = VLookup("STUDENT NUMBER", "NPARAMETER", False) Are there any other way to search a value from spreadsheet and return a value from other column? Any infromation is great appreciated, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
DLOOKUP AND VLOOKUP IN VBA
In the VB Editor, bring up HELP, then search for the WorksheetFunction Object.
Set myRange = Worksheets("Sheet1").Range("A1:C10") answer = Application.WorksheetFunction.Min(myRange) MsgBox answer Roy "Souris" wrote: I wanted to search a value in my spreadsheet using VBA. I tried to use VLOOKUP and DLOOKUP, but I got compile error "sub or function not defined" The code is like following code iStudent = DLOOKUP("[FIRST SEMI]", "NPARAMETER", "[SHEET NAME]" = "STUDENT NUMBER") iStudent = VLookup("STUDENT NUMBER", "NPARAMETER", False) Are there any other way to search a value from spreadsheet and return a value from other column? Any infromation is great appreciated, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If (Vlookup 0) working, but what if Vlookup cell does not exist | Excel Worksheet Functions | |||
VLookUp - Does the VLookUp return the exact information? | Excel Worksheet Functions | |||
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) | New Users to Excel | |||
Vlookup info being used without vlookup table attached? | Excel Worksheet Functions | |||
Dlookup? | Excel Programming |