- My Forums
- Tiger Rant
- LSU Recruiting
- SEC Rant
- Saints Talk
- Pelicans Talk
- More Sports Board
- Fantasy Sports
- Golf Board
- Soccer Board
- O-T Lounge
- Tech Board
- Home/Garden Board
- Outdoor Board
- Health/Fitness Board
- Movie/TV Board
- Book Board
- Music Board
- Political Talk
- Money Talk
- Fark Board
- Gaming Board
- Travel Board
- Food/Drink Board
- Ticket Exchange
- TD Help Board
Customize My Forums- View All Forums
- Show Left Links
- Topic Sort Options
- Trending Topics
- Recent Topics
- Active Topics
Started By
Message
Excel VBA Help - Range of data populating a sheet depending on which listbox case you pick
Posted on 9/27/18 at 3:26 pm
Posted on 9/27/18 at 3:26 pm
So I have a list of vendors, lets say Vendor 1, Vendor 2, Vendor 3. The vendors with description, pricing, and part numbers are on sheet 2. I want sheet 1 to contain a listbox that will make things a little easier to sort through. By selecting the listbox case (or selection), it will only populate data (on sheet 1) of the vendor I selected.
Vendor 1 has data throughout the range of A1:P12.
Vendor 2 has data throughout the range of A13:P26
etc..You get my point here..
My problem is that when doing a select case argument, it is throwing back errors when I type this code in:
Any help is appreciated. It appears that calling out a range of multiple cells this way is not correct.
Vendor 1 has data throughout the range of A1:P12.
Vendor 2 has data throughout the range of A13:P26
etc..You get my point here..
My problem is that when doing a select case argument, it is throwing back errors when I type this code in:
quote:
Select Case listbox1.listindex
Case 0
sheet1.range("A1:P12").value = Sheet2.range("A1:P12")
Case 1
sheet1.range("A13:P26").value = Sheet2.range("A13:P26")
End Select
End Sub
Any help is appreciated. It appears that calling out a range of multiple cells this way is not correct.
This post was edited on 9/27/18 at 3:32 pm
Posted on 9/28/18 at 2:05 am to VermilionTiger
A little drunk and not sure I follow completely. But if I understand what you are trying to do right...
I would probably setup each vendor on its own hidden tab. Then I'd nest IF statements for what to do if each drop down selection is taken ='ThatParticularVendor' have have it pull each value per that vendor tab.
As always, lots of ways to get things done in excel. More of a matter which you are more familar/comfortable doing.
I would probably setup each vendor on its own hidden tab. Then I'd nest IF statements for what to do if each drop down selection is taken ='ThatParticularVendor' have have it pull each value per that vendor tab.
As always, lots of ways to get things done in excel. More of a matter which you are more familar/comfortable doing.
Popular
Back to top
