U can use on error goto msg
msg: Inputbox()
On Dec 13, 9:52 am, Raj Mahapatra wrote:
> hi Vaibhav,
>
> thanks for this.
>
> but i want to dispaly an input box as "*lookfor is not in the rng*" while
> there is error.
>
>
>
> On Fri, Dec 10, 2010 at 1:32 PM, wrote:
> > Hi,
>
> > Add line;
>
> > O
hi Vaibhav,
thanks for this.
but i want to dispaly an input box as "*lookfor is not in the rng*" while
there is error.
On Fri, Dec 10, 2010 at 1:32 PM, wrote:
> Hi,
>
> Add line;
>
> On error resume next
>
> Rgds
> Vaibhav J
>
> Sent on my BlackBerry® from Vodafone
> --
Sub vlookup()
Dim lookfor As Range
Dim rng As Range
Dim col As Integer
Set lookfor = ActiveCell.Offset(0, -1)
Set rng = ActiveWorkbook.Worksheets("MV").Range("A:C")
col = 3
dept_code = Application.WorksheetFunction.vlookup(lookfor, rng, col,
0)
End Sub
On Fri, Dec 10, 2010 at 10:02
Hi,
Add line;
On error resume next
Rgds
Vaibhav J
Sent on my BlackBerry® from Vodafone
-Original Message-
From: Raj Mahapatra
Sender: excel-macros@googlegroups.com
Date: Fri, 10 Dec 2010 10:02:19
To:
Reply-To: excel-macros@googlegroups.com
Subject: $$Excel-Macros$$ Vlookup in Macro