Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Application.Vlookup Type Mismatch Error


I know this is going to be something really easy but I am having troubl
figuring it out. I keep getting a Type MisMatch Error on this:
bmrp = Application.VLookup(ComboBoxJumpToPart.Value, bmlu, 4, False)
I tried setting Dim bmrp As Variant but bmlu returns an integer an
bmrp returns a string which causes my code to fail.
Any Ideas? I'm stuck. Thanks Jody

Dim bmrp As String
Set bmlu = Range("BidmateParts")
bmrp = Application.VLookup(ComboBoxJumpToPart.Value, bmlu, 4, False)

If IsError(bmrp) Then
MsgBox "Yep, it's an error!"

Else
If Me.TextBoxGradeA_RetailValue.Value < (bmrp) Then
Me.TextBoxGradeA_RetailValue.Value = (bmrp)
Me.TextBoxGradeA_RetailValue.ForeColor = &HFF&
Me.LabelBidmatePriceDiffers.Visible = True
Me.LabelRetailPriceRaiseLower.Visible = True
Me.LabelRetailPriceRaiseLower.Caption = "Raised"
ElseIf Me.TextBoxGradeA_RetailValue.Value (bmrp) Then
Me.TextBoxGradeA_RetailValue.Value = (bmrp)
Me.TextBoxGradeA_RetailValue.ForeColor = &HFF&
Me.LabelBidmatePriceDiffers.Visible = True
Me.LabelRetailPriceRaiseLower.Visible = True
Me.LabelRetailPriceRaiseLower.Caption = "Lowered"
ElseIf Me.TextBoxGradeA_RetailValue.Value = (bmrp) Then
Me.LabelBidmatePriceDiffers.Visible = False
Me.TextBoxGradeA_RetailValue.ForeColor = &H80000008
Me.LabelRetailPriceRaiseLower.Visible = False
End If
End I

--
ssjod
-----------------------------------------------------------------------
ssjody's Profile: http://www.excelforum.com/member.php...fo&userid=3339
View this thread: http://www.excelforum.com/showthread.php?threadid=56763

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Application.Vlookup Type Mismatch Error


if the vlookup always returns a number and you want it to be a strin
try

bmrp=cstr(vlookup ....)

if it can return either a string or a number then use a variant

dim v as variant
v=vlookup(....)
bmrp=v

hope this help

--
tony
-----------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=56763

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Application.Vlookup Type Mismatch Error


Thanks Tony! The cStr was what I needed. That fixed my problem.

Jod

--
ssjod
-----------------------------------------------------------------------
ssjody's Profile: http://www.excelforum.com/member.php...fo&userid=3339
View this thread: http://www.excelforum.com/showthread.php?threadid=56763

Reply
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
vlookup type mismatch error Lilivati Excel Programming 3 July 13th 06 08:31 AM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
Application.Match Type mismatch error [email protected] Excel Programming 8 December 10th 04 09:58 AM


All times are GMT +1. The time now is 06:51 PM.

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"