Anthony's VBA Forum Index Anthony's VBA Forum
Where the knowledge is shared
Menu
 Anthony's VBA Forum IndexHome Page
 Anthony's VBA Forum IndexForum Index
FAQFAQ
MemberlistMemberlist
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesMessages
Log inLogin/Out

Quick Search

Advanced Search

Links
Consulting
Products

Who's Online
[ Administrator ]
[ Moderator ]


Contents of combo box on a form from a sheet in excel, how??

 
Post new topic   Reply to topic     Anthony's VBA Forum Index -> General Excel VBA
View previous topic :: View next topic  
Author Message
1cainr



Joined: 05 Jan 2009
Posts: 1

PostPosted: Mon Jan 05, 2009 1:55 pm    Post subject: Contents of combo box on a form from a sheet in excel, how?? Reply with quote

Hello,
I have created a combo box on a form in excel but now what i want to do it is...
When i click on the combo box to select some data, i want those to come from a sheet so they can be changed if needed to, example, sheet 1, range a1:a10.
Also but would like to get the first bit working but i have a text box on the form as well, so what ever is selected in the combo box, the data on the same row as in the combo box is put into there. example: select cat in combo box and in the text box will appear ginger (which is in the excel spreadsheet on the same row as cat)
Back to top
View user's profile Send private message
Kenneth Hobson
Gold Member
Gold Member


Joined: 25 Mar 2007
Posts: 21
Location: Tecumseh, OK

PostPosted: Sun Feb 15, 2009 4:58 pm    Post subject: Reply with quote

Welcome to the forum!

[code]
Private Sub UserForm_Initialize()
ComboBox1.RowSource = "A1:A10"
End Sub

Private Sub ComboBox1_Change()
TextBox1.ControlSource = "A" & ComboBox1.ListIndex + 1
TextBox1.SetFocus
End Sub
[/code]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Anthony's VBA Forum Index -> General Excel VBA All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group