Hi all,
In the below i have to find the value in sheet based on textbox 2 and i have to enter the textbox 1 value into the next column.. So for that i have to check the cell next cell was blank or not..with this command i cant execute that msg function so can someone suggest the solution...check the highlighted part.
Code
Private Sub CommandButton1_Click()
Dim Storage As String
Dim mothercoilID As String
Dim rng As Range
Dim rownumber As String
Storage = TextBox2.Text
x = 2
Do While Sheet3.Cells(x, 1) <> ""
Set rng = Sheet3.Columns("A:A").Find(What:=Storage, searchorder:=xlByRows)
If rng Is Nothing Then
MsgBox "Row Number not found"
GoTo ende
Else
Dim rng1 As Range
rownumber = rng.Row
Set rng1 = Sheet3.Cells(rownumber, 2)
If rng1 Is Nothing Then
mothercoilID = TextBox1.Text
rng1.Value = mothercoilID
Else
MsgBox "row is not empty"
End If
End If
Loop
ende:
End Sub
Display More