vba - populate a listbox on a userForm from spreadsheet..doubleclick  a row on listbox...populates message col...in another user form in a label

GlobaLevel
GlobaLevel used Ask the Experts™
on
vba - populate a listbox on a userForm


 
I have a listbox on my userform and I wanted to populate the
listbox with 3 columns from a spreadsheet...not sure how to do that...


Me.ListBox1.List = Range("A1:A3").Value

From    |  Message   | Recieved
---------------------------------------
jsmith  |  hey...         | 6-1-2010
amiller |  they...        | 6-3-2010

-=-=-==-=-=-=-=-=-=-=-=-

When they click on jsmith or anywhere on that row..."hey.." or ont the date "6-1-2010'

it will populate another userform....with their name in a
label and the FULL message in a big label or textbox, recieved in another label

..kinda like a email would...
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
you could link the excell spreadsheet into the database as a table. I think it is under file->import and in that process tell it to link to the excel file not import it. Then you can access the spreadsheet just like you would access a table.
actually it looks like it would be:


file->get external data -> link tables

full instructions are here: http://office.microsoft.com/en-gb/access-help/import-export-and-link-data-between-access-and-excel-HP001095095.aspx#BMjmp_linktoxldata

GlobaLevelProgrammer

Author

Commented:
i need to this with vba....
GlobaLevel,

What you are asking for is certainly doable using VBA. However I find your question rather confusing.

I understand the requirement that if you click anywhere on a row of data in a worksheet containing 3 columns you want that data to appear automatically in a 3-column ListBox on a Userform. What I'm not clear about is whether you want just that one row of data to appear in the ListBox or whether you want all the data from many rows to appear in the ListBox. Please clarify that.

The next part of your question also needs clarification. You wrote: "When they click on jsmith or anywhere on that row..."hey.." or ont the date "6-1-2010' it will populate another userform....with their name in a label and the FULL message in a big label or textbox, recieved in another label". By that do you mean that when you have already got all the data in ListBox1, that if you click on a row of data in ListBox1 it will automatically appear in another ListBox? Again please clarify.

I will await your full responses before starting the work.

Patrick
GlobaLevelProgrammer

Author

Commented:
patrickab,

I do apologize, for lack of clarity...please see attached documentation...I hope this more clear..please let me kow if you need more detail...thanks...
listbox-setup.txt
Book1.xls
GlobaLevelProgrammer

Author

Commented:
on the listbox-setup doc....I do not care what control is used to populate the user form that shows the entire message..though I think that lables would look the best...
GlobaLevel,

May I ask the naive question of "Why are you wanting to do this when all the functionality you have specified is already available in Outlook?" In fact Outlook gives you even more including: address book, email preview panels, sorting, tagging, follow-up flagging, attachment capability, searching, user-defined folders, forwarding, CC & BCC and so on. In addition to all of that you can even write VBA code for Outlook.

Patrick
GlobaLevelProgrammer

Author

Commented:
yes, because its a fun project .. : )  Can you help?
GlobaLevel,

Perhaps the attached file is close to what you are wanting.

Patrick
ListBox-multi-column-GlobaLevel-.xls
GlobaLevel - Thanks for the grade - Patrick

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial