A
aintlifegrand79
I have a userform (ufRepInfo) that fills about 30 text/check boxes when a
user hits the commandbutton (cbFindButton). Currently I have it where when
(cbFind) is pressed it looks up the values in the worksheet (Sheet1) for all
the text/check boxes based on the value entered into the textbox (tbZipCode).
This is working fine but now I need it perform a secondary check based on
the value entered in a combobox (cbMarkets), which has 5 different possible
values (We will call them A, B, C, D, E and they are represented as separate
columns in the worksheet and as checkboxes on the ufRepInfor). Basically
what I am looking for is to make it so that when I hit the Find button it
first looks in the worksheet for the value in (tbZipCode) and then also
checks the for the value in (cbMarkets). So if I entered "90210" into
tbZipCode and "C" into (cbMarkets) I want it to return the the rep info from
the line in the worksheet which has both 90210 as a zip code and the column
for "C" with a check in it. Here is my code currently and as I said it works
for finding the zip code. Thanks for any help I can get, I realize this is
maybe a little confusing but I tried to give as much detail as I possibly can
but only put the code in for two of the textboxes as the rest is basically
the same.
Private Sub cbFindButton_Click()
'Find Rep Info
tbRepNumber.Value =
Sheet1.Columns(1).Find(Val(tbZipCode.Value)).Offset(0, 1).Value
tbRepName.Value = Sheet1.Columns(1).Find(Val(tbZipCode.Value)).Offset(0,
2).Value
End Sub
user hits the commandbutton (cbFindButton). Currently I have it where when
(cbFind) is pressed it looks up the values in the worksheet (Sheet1) for all
the text/check boxes based on the value entered into the textbox (tbZipCode).
This is working fine but now I need it perform a secondary check based on
the value entered in a combobox (cbMarkets), which has 5 different possible
values (We will call them A, B, C, D, E and they are represented as separate
columns in the worksheet and as checkboxes on the ufRepInfor). Basically
what I am looking for is to make it so that when I hit the Find button it
first looks in the worksheet for the value in (tbZipCode) and then also
checks the for the value in (cbMarkets). So if I entered "90210" into
tbZipCode and "C" into (cbMarkets) I want it to return the the rep info from
the line in the worksheet which has both 90210 as a zip code and the column
for "C" with a check in it. Here is my code currently and as I said it works
for finding the zip code. Thanks for any help I can get, I realize this is
maybe a little confusing but I tried to give as much detail as I possibly can
but only put the code in for two of the textboxes as the rest is basically
the same.
Private Sub cbFindButton_Click()
'Find Rep Info
tbRepNumber.Value =
Sheet1.Columns(1).Find(Val(tbZipCode.Value)).Offset(0, 1).Value
tbRepName.Value = Sheet1.Columns(1).Find(Val(tbZipCode.Value)).Offset(0,
2).Value
End Sub