using a drop down list to select certain feilds

arlene_fool

Board Regular
Joined
Feb 17, 2007
Messages
55
I have created a spreadsheet here at work to stream line certain orders. For memory Reasons, and sanity Reasons, it is one spread sheet for 5 different types of requests (moves, changes, cancel...etc). the top portion of this sheet has general info that is needed for all the requests...but then it is broken up to 5 sections, one for each request reason. there is a drop down list in the top general section to select your reason for request, so the group receiving the form doesnt have to do to much thinking and go straight to the section they need. but i want to know if there is some way to make it so if someone selects cancel in this drop down list, only the cancel section appears, and not the other 4 sections, or if they choose move, only the move section appears and so on...
i have no idea where to even begin, please help me. thank you
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Have a play around with the menu command Data/Filter/Autofilter, as that should do exactly what you want.
 
Upvote 0
there is a drop down list in the top general section to select your reason for request, so the group receiving the form doesnt have to do to much thinking and go straight to the section they need.

So you already have the drop down, right? Does it take you to where you select? Do you then have codes attached to this drop down? What kind of drop down [combo box?] are you using?

RAM
 
Upvote 0
spreadsheeet.jpg


this is my spread sheet, i tried the filter, and that didnt seem to do it, so maybe seeing it will help you know what i need...

rows 2-9 are the general section, that will stay the same, in row 9 there is a drop down list for the different reasons for request, (move, cancel etc)
i need it so if you select cancel, everything below cancel comes up, (everything between the 2 grey bars), so its not just one or two feilds. is there anyway to do that?
 
Upvote 0
So you already have the drop down, right? Does it take you to where you select? Do you then have codes attached to this drop down? What kind of drop down [combo box?] are you using?

RAM

its just a standard data/validation/list, nothing fancy...
 
Upvote 0
Alright, this is what I propose:
Book1
ABCDEFG
1Cancellation
2DateMoverequest
3CustomerNameStementaccountChangerequest
4ContractId:
5Premisesaddress
6Siteid'sServiceacct:
7Gas:
8Electric
9Reasonforrequest
...


Freeze the sheet on row 9: Select row 10|Windows|Freeze Panes.

Per my idea you will need to insert blank rows in-between the end of each gray section. These blank rows are what "hide" the five different sections. You will need to insert enough space in-between the sections that only one section can be viewed until you scroll down to the next section, but we will not scroll manually, we will have codes in the combo box (drop down) and the scroll will be instant (as if you changed value instead of scrolling).

The combo box is linked to the F-row (F1:F5), and F1:F5 is linked from the name of each section (A10 and A20 as per above sheet, but these cell references will be changed in your worksheet to where ever you place these cell refs)).
Note that I have re-merged (A10 & B10 is merged and C10 not) the row excluding the parenthes in row F (as the text will be too long for the combo box).
The combo box is from View|Toolbars|Control Toolbox. Click on Combo Box and size it on the worksheet over cell C9. You might want to make that cell bigger.

I don't write code, I just dabble. I tried to edit the below code, I got from our good friend Erik Van Geit, to work in your sheet, but run into the same error and must ask the board to finish editing.
This code has done the same for me what I believe you ask for, except this code scroll columns to find the target. The code needs to be edited to scroll through the rows. The edit must be reasonable simple, but I'm running out of time to finish.

Code:
Private Sub ComboBox1_Change()

'Erik Van Geit
'find comboboxvalue and jump to there

Dim c As Range
Dim SC As Integer   'Scroll Column

Set c = Me.UsedRange.Find(ComboBox1, LookIn:=xlValues, lookat:=xlWhole)
    If c Is Nothing Then
    MsgBox """" & ComboBox1 & """not found", 48, "ERROR"
    Else
    SC = c.Column - 2
    ActiveWindow.ScrollColumn = SC
    End If
End Sub

This combo box has many properties that you can set, even background color to be easy to find.

This will be my last post for tonight and I'm inviting the board to finish of what I believe will work for what is requested per my understanding, and to finish edit the code.

Good luck.

RAM
 
Upvote 0
Finally!! I've been struggling with a bug, but here's your code:

Code:
Private Sub ComboBox1_Change()

'Erik Van Geit, Edit by Pennysaver
'find comboboxvalue and jump to there

Dim c As Range
Dim SC As Integer   'Scroll Row

Set c = Me.UsedRange.Find(ComboBox1, LookIn:=xlValues, lookat:=xlWhole)
    If c Is Nothing Then
    MsgBox """" & ComboBox1 & """not found", 48, "ERROR"
    Else
    SC = c.Row - 0
    ActiveWindow.ScrollRow = SC
    End If
End Sub

The bug was the range to the combo box was placed in F1:F5. When I moved the range to a position in column A under the spreadsheet, as displayed above, it worked out. Don't know why this is. EDIT: Maybe due to code was looking for the first reference from the drop down list and as row 1-9 was frozen, and these references were in F1:F5 it could not scroll. The spreadsheet started to scroll when I unfroze, but it scrolled along the range in F1:F5.


Everything else in my workout stays the same.

Post back if you need more help.

RAM
 
Upvote 0
thanks for the reply, i am going to try to get that code to work...
as for the sheets being posted, unfortunatly i couldnt do that with this one, as you see all those green areas, if i posted this sheet there would be trouble at work as this is proprietary info on there.
 
Upvote 0

Forum statistics

Threads
1,221,618
Messages
6,160,872
Members
451,674
Latest member
TJPsmt

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