I've been searching the Internet for the past two days and couldn't find any solution... here is the problem...
I have a table with 3 columns and 4 rows (including headers on the first row) . I have to use combo box or list box and put all the headers (on the first row) in it so that when I click on a drop-down button it will show all the list of headers (text). Then, when select a header from the list, the values (on multiple rows) under that header will be selected automatically.
Then I would like to create 3 buttons to export all the selected values under that header (column) to SharePoint in 3 different files Excel, Word, and Powerpoint.
This way I need to send out 1 column at a time not the whole table.
Any help would be highly appreciated.
Thank you.
P.S. I am using Excel 2007
Last edited by mess07; 08-29-2009 at 10:15 PM.
With sch a small table why bother with code to select the column?
Add a ComboBox from the Controls Toolbar then use this code
This will load the combobox & copy the selected column.Option Explicit Private Sub ComboBox1_Change() Dim Col As Long Col = Me.ComboBox1.ListIndex + 1 Range(Cells(1, Col), Cells(Rows.Count, Col).End(xlUp)).Copy End Sub Private Sub Worksheet_Activate() Dim rng As Range Dim cl As Range Set rng = Range("A1:C1") Me.ComboBox1.Clear For Each cl In rng Me.ComboBox1.AddItem cl.Value Next cl End Sub
Last edited by royUK; 08-30-2009 at 04:11 AM.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Thanks a lot royUK for the quick solution...
I've tried the code but for some reason it is giving me error saying "Me" is not define, not sure what does that mean.
I am attaching the actual file, may be it will explain you better as to what I am trying to achieve here.
Thank you!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks