Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-08-2018, 07:45 AM
ksikor14 ksikor14 is offline User Control Windows 10 User Control Office 2016
Novice
User Control
 
Join Date: May 2018
Location: Tulsa
Posts: 1
ksikor14 is on a distinguished road
Default User Control

I desperately need help. I have an Excel Spreadsheet on the Data Tab I am pulling in all the data from a SQL Table. On the First Tab I have pulled out all the columns I want to pull in from the data tab. However I need to make a list box or control or something that allows the user to select a scenario and then all the data associated with that scenario on the Data Tab gets pulled in. Please someone I can't make this work I can add the Data to the data tab with all of the scenarios in it. I just can't figure out how the user can select the scenario on Tab 1 and then all the data gets populated to the appropriate columns. I tried list but don't know how to focus I tried scenario manager or data validation but I have 40 columns and 30 rows that need to be pulled in after the scenario is chosen.



Any help or suggestion would be greatly appreciated.
Reply With Quote
  #2  
Old 05-08-2018, 08:18 AM
Logit Logit is offline User Control Windows 10 User Control Office 2007
Expert
 
Join Date: Jan 2017
Posts: 587
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Will the built in Data Filter suffice ?

https://support.office.com/en-us/art...6-27b932e186e0
Reply With Quote
  #3  
Old 05-08-2018, 08:27 AM
NoSparks NoSparks is offline User Control Windows 7 64bit User Control Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

If you use data validation you can use the Worksheet_Change event to run a macro based on the selection,
but somewhere you'd have to layout what the possible scenarios are.

Any chance of you attaching a sample workbook indicative of what you're working with and trying to achieve?
Reply With Quote
  #4  
Old 05-08-2018, 08:36 AM
ArviLaanemets ArviLaanemets is offline User Control Windows 8 User Control Office 2016
Expert
 
Join Date: May 2017
Posts: 932
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Obviously you get data from SQL Server with ODBC query. Let's assume the query is something like
Code:
SELECT * FROM SqlView
You can have instead a query
Code:
SELECT * FROM SqlView WHERE Field1 = ? AND Field2 = ?
When trying to run the query it will ask for 1st parameter, and then for 2nd parameter. You can point cells in Excel worksheet as sources for those parameters, and set the query to be executed whenever those cells will change.

On sheet where queried data appear, leave/insert some empty rows at top (at least the number of parameters +1). Define Data validations to select parameter values at top cells, and select some parameter values there. Now redefine your query like was shown before, and point cells with selected parameters when asked.
Reply With Quote
Reply

Tags
excl, list, user control



Similar Threads
Thread Thread Starter Forum Replies Last Post
Could you help me create a control button/check box to enable user to delete a row? baes10 Word Tables 2 12-11-2017 10:10 AM
User Control The USER ACCOUNT CONTROL window does not appear when opening an EXCEL file NathanEat Word 4 05-27-2015 09:04 PM
How can I get Outlook from one user to another w/o a .pst file (primary user on computer is corrupt) Tenmakk Outlook 0 03-01-2015 12:49 PM
User Control Rich Text Content Control - Allow User Formatting keithacochrane Word 1 05-28-2012 05:06 PM
issue in nested user control selva Misc 1 10-20-2011 10:18 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft