![]() |
Dynamically hiding fields using VBA
Hi,
I have a tool that I have built using standard Excel functions with no VBA. It is an in-depth tool that uses multiple vlookups to provide a user friendly pricing tool. One sheet (Input Sheet) contains all the input information via user selectable drop downs and the second uses the information from the first to create a quote. I am trying to make this more interactive and want to add the ability for certain fields to appear and/or disappear on the input sheet based off of previous selections. Here is an example of what I would want: User choose option A in drop down 1. Because of this choice, drop down 2 appears. If user chose option 2 in A then drop down two would not appear or potentially would appear with different information. I am not sure how to do this with VBA. This is clearly a simple if/ then type problem, but I am a VBA novice and so am not sure where to start. Any code snippets or links to places that have snippets would be helpful. TIA! JL |
Dynamically hiding fields using VBA
On Mar 12, 8:20 am, "JayL" wrote:
Hi, I have a tool that I have built using standard Excel functions with no VBA. It is an in-depth tool that uses multiple vlookups to provide a user friendly pricing tool. One sheet (Input Sheet) contains all the input information via user selectable drop downs and the second uses the information from the first to create a quote. I am trying to make this more interactive and want to add the ability for certain fields to appear and/or disappear on the input sheet based off of previous selections. Here is an example of what I would want: User choose option A in drop down 1. Because of this choice, drop down 2 appears. If user chose option 2 in A then drop down two would not appear or potentially would appear with different information. I am not sure how to do this with VBA. This is clearly a simple if/ then type problem, but I am a VBA novice and so am not sure where to start. Any code snippets or links to places that have snippets would be helpful. TIA! JL JL, There are a number of ways to do what you are talking about. If you are a novice at VBA then I would recommend the following book: Birnbaum, Duane. Microsoft Excel VBA Programming for the Absolute Beginner, 2nd Edition. Thomson Course Technology: 2005. (ISBN: 1-59200-729-5) It's a great introduction to Excel VBA and you can get it from Amazon or another book provider for cheap. It includes numerous examples, and it includes a CD with all the source code to the examples. It may seem like more material than you want for right now, but this being said, reading through this book would be well worth your time. If you're looking for something quicker, utilize VBE Help and search "if statement" and find "Using If...Then...Else Statements" and also search "case" and find "Select Case Statement." Matt |
All times are GMT +1. The time now is 01:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com