ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Searching and matching the textvalues in specific column ranges (https://www.excelbanter.com/excel-programming/305341-searching-matching-textvalues-specific-column-ranges.html)

gki[_12_]

Searching and matching the textvalues in specific column ranges
 
Hello,

I would like to search the textbox value in the worksheet and specifi
ranges. If the textbox value matchs, then I want a new userform to com
on the screen.

Something like;
Private Sub CommandButton1_Click()
If txtbox.value matchs
Sheets("Sheet1").Range("C2:C140").Find(What:=txtbo x.value) Then
Unload Me
Load Userform2
Userform2.Show

End If

If txtbox.value matchs
Sheets("Sheet1").Range("D2:D290").Find(What:=txtbo x.value) Then
Unload Me
Load Userform3
Userform3.Show
End If

End Sub

I dont understand why I get error already in the first row..(I
txtbox....)

Can anyone see where my problem is??

Thanks

gk

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com