Nipendra.dhiman
Member
Hi experts,
let suppose i have a database in excel sheet1 and a userform with in the same spreadsheet, i have to update database every day now it’s a very heavy amount of data.
the challenge is i am getting whenever i am going to enter some new values it gets duplicate some time because of repeated entry. so i have decided to use a vba form to search then save.
"
Private Sub CommandButton1_Click()
Dim i As Integer, ValueToFind As String
Dim copyrng As String
ValueToFind = TextBox1.Text
For i = 1 To 2539
If Cells(i, 1).Value = ValueToFind Then
Sheet1.Activate
copyrng = "A" & i & ":" & "H" & i
ListBox1.RowSource = Range(copyrng).Address
MsgBox ("Found value on row No. " & i)
Exit Sub
End If
Next i
MsgBox ("Value not found!")
End Sub
currently i am going with this code but here i am getting some challenges because this is trying to find whole string and need to find like CTRL+F.
Example if i am finding "nipendra" and values exist in database then i am getting the same but when i am trying to find "nip" ro "nipend" then it’s not working.
this code need to work like CTRL+F does work.
Any help or suggestion
thanks in advanced
Nipendra
let suppose i have a database in excel sheet1 and a userform with in the same spreadsheet, i have to update database every day now it’s a very heavy amount of data.
the challenge is i am getting whenever i am going to enter some new values it gets duplicate some time because of repeated entry. so i have decided to use a vba form to search then save.
"
Private Sub CommandButton1_Click()
Dim i As Integer, ValueToFind As String
Dim copyrng As String
ValueToFind = TextBox1.Text
For i = 1 To 2539
If Cells(i, 1).Value = ValueToFind Then
Sheet1.Activate
copyrng = "A" & i & ":" & "H" & i
ListBox1.RowSource = Range(copyrng).Address
MsgBox ("Found value on row No. " & i)
Exit Sub
End If
Next i
MsgBox ("Value not found!")
End Sub
currently i am going with this code but here i am getting some challenges because this is trying to find whole string and need to find like CTRL+F.
Example if i am finding "nipendra" and values exist in database then i am getting the same but when i am trying to find "nip" ro "nipend" then it’s not working.
this code need to work like CTRL+F does work.
Any help or suggestion
thanks in advanced
Nipendra