need help with VBA code

Mark Lowe

New Member
Joined
Feb 17, 2002
Messages
8
The down & dirty....

I have a register for inventory (in this case, animals), & I'm trying to create a form that will ease the input of new items.

First, the database....

Sheet1 has three columns, A, B & C
Column A is the type of animal (ie, cat, dog, horse)
Column B is the Breed
Column C is the Name of the pet.

On the Userform I'm trying to make, I have two comboboxes (one for animal & one for breed) & one text box that & will type in the name.

Here is my question. Once I've selected the "animal" (let's say dog, for this instance) from the combobox, what code do I need to only display the "breeds" associated with dogs.

In more Excel terms, I need for breedcombobox to show only the values of sheet1's column B if column A's value equals animalcombobox's value.

I'm guessing it's a countif function, but I'm stumbling with no sign of recovery.

I'm greatful for any replies.
 
Don't get angry, I'm a beginner fo the most part as well. Just please try and give as much information as possible. Everyone in here knows what it is like to be stuck and the frustration involved. Especially if payment or time constraints are laying heavy on you. I should not have posted my negative reply, but I did waste my time trying to help you out because of a lack of clarity. You do not need to have an extensive knowledge of VB to get good help in here. You do need to express your goals as explicitly as possible. Sorry to tick you off.
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,213,535
Messages
6,114,194
Members
448,554
Latest member
Gleisner2

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