ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   get value from a database (https://www.excelbanter.com/excel-programming/352599-get-value-database.html)

tankimpong[_2_]

get value from a database
 

Dear all,

i have a question need your assist.
I have a row of part number in a sheet examp : 123, 324, 134 ....
I want to get a value for each part from a database from another
worksheet.
let say in database :
Part number value
123 3
324 5
134 0

After searching, the value will just appear at second row of the part
number.

Thanks a lot


--
tankimpong
------------------------------------------------------------------------
tankimpong's Profile: http://www.excelforum.com/member.php...o&userid=31248
View this thread: http://www.excelforum.com/showthread...hreadid=509227


Norman Jones

get value from a database
 
Hi Tankimpong,

See the VLookup function in Excel help.

See also the Contextures VLookup page at:

http://www.contextures.com/xlFunctions02.html


---
Regards,
Norman


"tankimpong" wrote
in message ...

Dear all,

i have a question need your assist.
I have a row of part number in a sheet examp : 123, 324, 134 ....
I want to get a value for each part from a database from another
worksheet.
let say in database :
Part number value
123 3
324 5
134 0

After searching, the value will just appear at second row of the part
number.

Thanks a lot


--
tankimpong
------------------------------------------------------------------------
tankimpong's Profile:
http://www.excelforum.com/member.php...o&userid=31248
View this thread: http://www.excelforum.com/showthread...hreadid=509227




tankimpong[_3_]

get value from a database
 

HI Norman,

Thanks a lot for your help.
If i want create a macro ,

Sub Assy_Part()
Row = Application.WorksheetFunction.CountA(Range("A:A")) + 1
For x = 1 To Row
'VLOOKUP(A4,'[data base.xls]Sheet1'!$A$1:$C$16,3,FALSE)
(how to put vlookup into this program?)
Else
End If
Next
End Sub

Thanks

Tan


--
tankimpong
------------------------------------------------------------------------
tankimpong's Profile: http://www.excelforum.com/member.php...o&userid=31248
View this thread: http://www.excelforum.com/showthread...hreadid=509227


Norman Jones

get value from a database
 
Hi Tan,

Try:

'=============
Sub Assy_Part()
Dim i As Long

i = Cells(Rows.Count, "A").End(xlUp).Row

Range("B2:B" & i).FormulaR1C1 = _
"=VLOOKUP(RC[-1],'[data base.xls]Sheet1'!R1C1:R16C3,3,0)"

End Sub
'<<=============


---
Regards,
Norman


"tankimpong" wrote
in message ...

HI Norman,

Thanks a lot for your help.
If i want create a macro ,

Sub Assy_Part()
Row = Application.WorksheetFunction.CountA(Range("A:A")) + 1
For x = 1 To Row
'VLOOKUP(A4,'[data base.xls]Sheet1'!$A$1:$C$16,3,FALSE)
(how to put vlookup into this program?)
Else
End If
Next
End Sub

Thanks

Tan


--
tankimpong
------------------------------------------------------------------------
tankimpong's Profile:
http://www.excelforum.com/member.php...o&userid=31248
View this thread: http://www.excelforum.com/showthread...hreadid=509227




tankimpong[_4_]

get value from a database
 

thanks a lot Norman, it works.


--
tankimpong
------------------------------------------------------------------------
tankimpong's Profile: http://www.excelforum.com/member.php...o&userid=31248
View this thread: http://www.excelforum.com/showthread...hreadid=509227


tankimpong[_5_]

get value from a database
 

Hi Norman,

I have another problem need your help.
checking column 2, if meet 10 then the whole row will be deleted.

X-210-251-11 11 1 BAG
1-528-692-21 10 01 S 1 DRY,
1-528-692-31 11 01 S 1 DRY,
1-528-692-61 10 01 S 1 DRY,
2-630-948-26 11 1 MANUAL,

sorry for disturbing you again.

Thanks

Tan


--
tankimpong
------------------------------------------------------------------------
tankimpong's Profile: http://www.excelforum.com/member.php...o&userid=31248
View this thread: http://www.excelforum.com/showthread...hreadid=509227



All times are GMT +1. The time now is 01:26 PM.

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