PDA

View Full Version : Run time error "438" - Object doesn't support this property or method.



Jpgohel
06-04-2017, 03:08 AM
Hello Everyone,

I am facing the error "Run time error "438" - Object doesn't support this property or method. "


Private Sub Cmdfin_Click()
Dim f As Integer
Dim d As String
Dim lnRow As Long, lnCol As Long
Dim sht As Worksheet
Set sht = ActiveSheet
f = txtId.Text
lnCol = 1


lnRow = sht.Cells(lnCol, 1).EntireCol.find(What:=f, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Column -- got the error here.
d = ActiveCell.Address
Exit Sub



End Sub

Kindly suggest.

YasserKhalil
06-04-2017, 04:09 AM
Please put the code between code tags
Try this line instead

lnRow = sht.Columns(lnCol).Find(What:=f, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Column

Bob Phillips
06-04-2017, 09:11 AM
It's EntireColumn , not EntireCol!

SamT
06-04-2017, 10:05 AM
Dim f As Integer

f = txtId.Text
Hunh?

mdmackillop
06-04-2017, 10:33 AM
lnRow = sht.Cells(...False).Column A recipe for confusion!