Hello
I am searching string which is typed in Textbox and returns the Row number an Cell Address of that string.
I've used Special Cells(xlTypeBlanks) because majority of rows in the Range are with 2 or 3 Empty Cells .
Few Rows are NON-EMPTY because of this I get Error 1004 (Blank) Cells Are Not Found
Although Using On Error Resume Next it works Perfectly.
Will there be any possibility Without using On Error Resume Next we can avoid Error 1004
Your valuable inputs shall be appreciated
Thanks
NimishK
I am searching string which is typed in Textbox and returns the Row number an Cell Address of that string.
I've used Special Cells(xlTypeBlanks) because majority of rows in the Range are with 2 or 3 Empty Cells .
Few Rows are NON-EMPTY because of this I get Error 1004 (Blank) Cells Are Not Found
Although Using On Error Resume Next it works Perfectly.
Will there be any possibility Without using On Error Resume Next we can avoid Error 1004
VBA Code:
Private Sub UserForm_Initialize()
TextBox1.Text = "12345678"
End Sub
Private Sub CmdFindWhichRow_Click()
Dim getRowNo As Range, BlankCells As Range, BlankCellsOfGetRowNo As Range
Set getRowNo = Worksheets("Sheet5").Range("E:E").Find(TextBox1.Text, LookIn:=xlValues, LookAt:=xlWhole)
Set BlankCellsOfGetRowNo = Worksheets("Sheet5").Range("A" & getRowNo.Row & ":J" & getRowNo.Row).SpecialCells(xlCellTypeBlanks)
'The above Gives Run Time Error 1004 as The Row Was full with NON/BLANK (EMPTY) Cells
End Sub
Your valuable inputs shall be appreciated
Thanks
NimishK