RE: $$Excel-Macros$$ Need help in Excel-VBA code to write function in coding

2012-01-30 Thread Rajan_Verma
You can use this for text also Sub isExist() On Error Resume Next If WorksheetFunction.Match(Range("rngValues").Text, Worksheets("Sheet2").Range("d4:d10"), 0) Then If Err.Number = 1004 Then Err.Clear On Error GoTo 0: On Error GoTo -1 MsgBox "Values not fo

Re: $$Excel-Macros$$ Need help in Excel-VBA code to write function in coding

2012-01-29 Thread dguillett1
try Option Explicit Sub Look2() Dim mf As Range Set mf = Sheet2.Columns("D").Find(What:=Range("b4"), _ LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _ searchDirection:=xlNext, SearchFormat:=False) If Not mf Is Nothing Then MsgBox mf.Row End Sub Don Guillett SalesAid Software

RE: $$Excel-Macros$$ Need help in Excel-VBA code to write function in coding

2012-01-20 Thread Rajan_Verma
Try this one: Sub isExist() On Error Resume Next If WorksheetFunction.Match(Range("rngValues").Value, Range("List"), 0) Then If Err.Number = 1004 Then Err.clear On error goto 0:on Error Goto -1 MsgBox "Values not found" Else MsgBox Range("rngValues").Value

Re: $$Excel-Macros$$ Need help in Excel-VBA code to write function in coding

2012-01-18 Thread NOORAIN ANSARI
Dear Ashish, Please ignore previous mail..use it Function check_value(rng As Range) As String Dim cell, rng1 As Range Set rng1 = Sheet2.Range("D4:D10") For Each cell In rng1 If cell.Value = rng.Value Then MsgBox "Bill is made of this Chassis", vbInformation Exit Function End If Next cell End Func

Re: $$Excel-Macros$$ Need help in Excel-VBA code to write function in coding

2012-01-18 Thread NOORAIN ANSARI
Dear Ashish, Excel 2007 File Type Extension - xlsx - Excel 2007 XML Workbook - xlsm - Excel 2007 XML Macro-Enabled Workbook - xltx - Excel 2007 XML Template - xltm - Excel 2007 XML Macro-Enabled Template - xlsb - Excel 2007 binary wo

Re: $$Excel-Macros$$ Need help in Excel-VBA code to write function in coding

2012-01-18 Thread NOORAIN ANSARI
Dear Ashish, Please try below code... Function check_value(rng As Range) As String Dim cell, rng1 As Range Set rng1 = Sheet2.Range("D4:D10") For Each cell In rng1 If cell.Value = rng.Value Then MsgBox "Bill is made of this Chassis", vbInformation End If Exit Function Next cell End Function see a