Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default How do I Keep a Combo Box "Focused" on difrferent cells.

Is there anyway to select a cell, say B1, then click a selection from a Combo
Box and have it populate B1 with that value. I know how to add one Combo Box
and associate it with 1 cell but I want to select say cell B2, select an
entry from the same Combo Box nd have that value populate B2 with the new
entry vs. changing B2 to the B1 Combo Box value.

I basically want 1 Combo Box on a sheet, select different cells in the same
sheet and have those values populate the cell based on the Combo Box
selection.

I don't think I can do it but wanted to ask.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 434
Default How do I Keep a Combo Box "Focused" on difrferent cells.

hi, !

embed a combobox from "controls toolbar" (populate it as needed)
and use the '_selectionchange' event in "that" sheet to set it's "LinkedCell" property

hth,
hector.

__ OP __
Is there anyway to select a cell, say B1, then click a selection from a Combo Box
and have it populate B1 with that value.
I know how to add one Combo Box and associate it with 1 cell
but I want to select say cell B2, select an entry from the same Combo Box
nd have that value populate B2 with the new entry vs. changing B2 to the B1 Combo Box value.

I basically want 1 Combo Box on a sheet, select different cells in the same sheet
and have those values populate the cell based on the Combo Box selection.

I don't think I can do it but wanted to ask.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default How do I Keep a Combo Box "Focused" on difrferent cells.

Hi,

I am not familiar with the coding for a Combo Box from "Controls Toolbar".
Can you give me some generic code I can modify with the tab names, etc.?

"Héctor Miguel" wrote:

hi, !

embed a combobox from "controls toolbar" (populate it as needed)
and use the '_selectionchange' event in "that" sheet to set it's "LinkedCell" property

hth,
hector.

__ OP __
Is there anyway to select a cell, say B1, then click a selection from a Combo Box
and have it populate B1 with that value.
I know how to add one Combo Box and associate it with 1 cell
but I want to select say cell B2, select an entry from the same Combo Box
nd have that value populate B2 with the new entry vs. changing B2 to the B1 Combo Box value.

I basically want 1 Combo Box on a sheet, select different cells in the same sheet
and have those values populate the cell based on the Combo Box selection.

I don't think I can do it but wanted to ask.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 434
Default How do I Keep a Combo Box "Focused" on difrferent cells.

hi, !

I am not familiar with the coding for a Combo Box from "Controls Toolbar".
Can you give me some generic code I can modify with the tab names, etc.?


assumptions:
- there is a list-range in any worksheet named "TheList" as the source for a ComboBox1 control embedded in your worksheet
- you want the combo linked only if activecell is over column A (otherwise the combo has nothing to select from)
- also, if you type something *out of* the list, activecell will accept this entry (but will be left out of the list)

hth,
hector.

copy/paste (or tpe) the following in "the sheet" code module where the combo is embedded

' fill the combo only if activecell is in column A
Private Sub ComboBox1_GotFocus()
If ActiveCell.Column = 1 Then
ComboBox1.ListFillRange = "TheList"
ComboBox1.LinkedCell = ActiveCell.Address
Else: ComboBox1.LinkedCell = ""
End If
End Sub

' empty the combo once a selection is made and/or activecell "moved"
Private Sub ComboBox1_LostFocus()
ComboBox1.ListFillRange = ""
ComboBox1.LinkedCell = ""
ComboBox1 = ""
End Sub

' use {enter} key to accelerate the selection from the combo
Private Sub ComboBox1_KeyDown( _
ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then SendKeys "{Esc}"
End Sub

__ previous __
embed a combobox from "controls toolbar" (populate it as needed)
and use the '_selectionchange' event in "that" sheet to set it's "LinkedCell" property

__ OP __
Is there anyway to select a cell, say B1, then click a selection from a Combo Box
and have it populate B1 with that value.
I know how to add one Combo Box and associate it with 1 cell
but I want to select say cell B2, select an entry from the same Combo Box
nd have that value populate B2 with the new entry vs. changing B2 to the B1 Combo Box value.

I basically want 1 Combo Box on a sheet, select different cells in the same sheet
and have those values populate the cell based on the Combo Box selection.

I don't think I can do it but wanted to ask.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default How do I Keep a Combo Box "Focused" on difrferent cells.

Perfect !! Working great. I really appreciate your help.

"Héctor Miguel" wrote:

hi, !

I am not familiar with the coding for a Combo Box from "Controls Toolbar".
Can you give me some generic code I can modify with the tab names, etc.?


assumptions:
- there is a list-range in any worksheet named "TheList" as the source for a ComboBox1 control embedded in your worksheet
- you want the combo linked only if activecell is over column A (otherwise the combo has nothing to select from)
- also, if you type something *out of* the list, activecell will accept this entry (but will be left out of the list)

hth,
hector.

copy/paste (or tpe) the following in "the sheet" code module where the combo is embedded

' fill the combo only if activecell is in column A
Private Sub ComboBox1_GotFocus()
If ActiveCell.Column = 1 Then
ComboBox1.ListFillRange = "TheList"
ComboBox1.LinkedCell = ActiveCell.Address
Else: ComboBox1.LinkedCell = ""
End If
End Sub

' empty the combo once a selection is made and/or activecell "moved"
Private Sub ComboBox1_LostFocus()
ComboBox1.ListFillRange = ""
ComboBox1.LinkedCell = ""
ComboBox1 = ""
End Sub

' use {enter} key to accelerate the selection from the combo
Private Sub ComboBox1_KeyDown( _
ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then SendKeys "{Esc}"
End Sub

__ previous __
embed a combobox from "controls toolbar" (populate it as needed)
and use the '_selectionchange' event in "that" sheet to set it's "LinkedCell" property

__ OP __
Is there anyway to select a cell, say B1, then click a selection from a Combo Box
and have it populate B1 with that value.
I know how to add one Combo Box and associate it with 1 cell
but I want to select say cell B2, select an entry from the same Combo Box
nd have that value populate B2 with the new entry vs. changing B2 to the B1 Combo Box value.

I basically want 1 Combo Box on a sheet, select different cells in the same sheet
and have those values populate the cell based on the Combo Box selection.

I don't think I can do it but wanted to ask.






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 434
Default How do I Keep a Combo Box "Focused" on difrferent cells.

hi, !

Perfect !! Working great. I really appreciate your help...


thanks for your feed-back ;)

regards,
hector.

p.s. don't ever think again that "something" can not be done in excel...
exceptional exceptions can be made, but no so much (afaik) :))


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I disable "cutting cells" and "drag and drop "in excel ? mwoody Excel Worksheet Functions 4 August 25th 08 03:53 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Check if cells contain the word "Thailand", return "TRUE" ali Excel Worksheet Functions 7 September 14th 07 09:53 AM
Text resizes in combo box when "Move and size with cells" set RzB Excel Discussion (Misc queries) 3 February 20th 07 06:40 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 04:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"