Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how can I disable "cutting cells" and "drag and drop "in excel ? | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Check if cells contain the word "Thailand", return "TRUE" | Excel Worksheet Functions | |||
Text resizes in combo box when "Move and size with cells" set | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |