LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,069
Default vlookup text in vba

Hi to all...
I am currently using Excel 2003. I am trying to use vlookup in VBA. First I
have a workbook with 8 spreadsheets. I have a Master Parts List spreadsheet
that updates 7 other worksheets within the workbook with the Vlookup in each
cell looking back at the Master Parts List spreadsheet. I would like to
accomplish this in VBA when I go to any one of the other spread sheets in
column A active cell value I type it looks up part number, description, and
unit of measure. I need the value in column A to remain text because I have
both numbers and alpha characters as part numbers. Here is what I have and I
keep getting #N/A.

Sub Lookup()
Dim lookuprng As Range
Dim myVal As String 'or whatever
Set lookuprng = Worksheets("Master Parts List").Range("$A$8:$D$5000")
myVal = ActiveCell.Value
ActiveCell.Offset(0, 1) = Application.VLookup(myVal, lookuprng, 2, False)
If myVal = "" Then
ActiveCell.Offset(0, 1) = ""
End If
End Sub

Thanks for any help I can get.


 
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
look for text not using vlookup and sum if Fanny Excel Discussion (Misc queries) 6 March 13th 09 10:18 AM
VLOOKUP (with text) Woody13 Excel Discussion (Misc queries) 3 January 24th 06 07:20 PM
Using VLOOKUP and text Tara C. Excel Discussion (Misc queries) 1 December 17th 05 04:40 PM
Vlookup using text gersumabat Excel Worksheet Functions 2 November 1st 05 09:18 PM
Vlookup a value and text raboone Excel Discussion (Misc queries) 1 June 8th 05 08:04 PM


All times are GMT +1. The time now is 09:18 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"