Search box on userform

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,738
Office Version
  1. 2007
Platform
  1. Windows
Morning,

I have a userform with a Combobox which is populated from customers names from my POSTAGE worksheet.
I would like to select a customers name from the list & then be taken to that customer on my worksheet.
Currently my worksheet is sorted by date example A8 01/10/2015 to current info cell A646 30/10/2018
This then means that the customers names in column B are not in any order.

This is how it should work.
Sort ComboBox names A-Z
Browse through the list & select a customer.
Upon selecting a customer close userform
Then that customer is selected on my worksheet.

Here is some information to assist you.

Worksheet is called POSTAGE
Customers name will always be in column B
The range is B8 & onwards
The userform is called PostageTransferSheet
The Combobox is called CustomerSearchBox

Thanks & have a nice day.
 
@MAIT
I have been playing with this new code and it works well.
I have noticed that i need to apply something for duplicated customers or more than 1 customer with the same name.

I have now started a new post for this.
Thanks.
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
@MAIT
I have been playing with this new code and it works well.
I have noticed that i need to apply something for duplicated customers or more than 1 customer with the same name.

I have now started a new post for this.
Thanks.

I see no new posting.

So what is your plan now
How do you plan to deal with Duplicate name?
See that is why people should always be identified by Company id number or such.
 
Upvote 0
I will need to have a code that when I type in a cell in column B alert me if there is a match.
So if I am alerted that Tom Jones exists I can then enter the new Tom Jones like Tom Jones2 etc.

Then when I use the new code that we made earlier I can select any Tom Jones and see every record.

I can’t add a user ID for customers as they are not staff etc.
 
Upvote 0
Not sure what happened there but just did another one.
It is called "Code to stop duplicate entries"

Thanks
 
Upvote 0
To find all your duplicates in column B
Run this script
It will color every cell Green if its a duplicate

Code:
Sub Color_Duplicates()
'Modified  10/4/2018  12:57:18 AM  EDT
Application.ScreenUpdating = False
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "B").End(xlUp).Row
Dim Rng As Range
Dim c As Range
Set Rng = Range(Range("B1"), Range("B" & Rows.Count).End(xlUp))
    
    For Each c In Rng
        If WorksheetFunction.CountIf(Rng, c.Value) > 1 Then c.Interior.ColorIndex = 4
    Next
Application.ScreenUpdating = False
End Sub
 
Upvote 0
Morning,
I did a similar thing last night and renamed all of the duplicate names.
Now all the names in my sheet are unique.

Need to now start work on the code which checks as i press the click to transfer button.
This was a new post, Did you see it ?

Thanks
 
Upvote 0
I saw a posting about search for duplicate values Yes.
And some users were saying you should do things differently
I did see you put in your script
TextBox1.Value = Now

And then formatted as date.
As I had suggested Date

Now gives date and time
As Date gives just Todays Date
I don't understand why you want Now but then format it as only date.

But hey it's your script.

It looks like this script has something to do with Ebay

I would think if customers are using this to order items each customer at the beginning would be given a Account number.

I'm sure Ebay does not search for customers by name. They would maybe have thousands of users with same name.
 
Last edited:
Upvote 0
Hi,
I have the date thing now sorted.

This post is now finished.

Forget the ebay thing as you are going off track a bit.
This form is to keep a register of where the item was sold,dont read to much into this please.

Now i started a new post late last night where i required the following code,please take a look for this new post.

When a member of staff uses your new code on the POSTAGE sheet i do not want duplicate entries on the sheet.
So i need to overcome that, So this new code will run when i either press the transfer button or after i type the customers name & then click in the next text box the code will then run 7 check to make sure that customer does not exist on my sheet.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top