Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I searched through the forum but I can't find the solution I'm looking
for. I want the Cell Link in a single Spinner control to depend on the value of another cell. In other words, if A1=0, then the Spinner control will index C1, and if A1=1 then the Spinner control will index cell C2. Is this possible? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
BJ,
ry linking the spinner to a cell with the formula =IF(A1=0,C1,C2) HTH, Bernie MS Excel MVP "BJ" wrote in message ... I searched through the forum but I can't find the solution I'm looking for. I want the Cell Link in a single Spinner control to depend on the value of another cell. In other words, if A1=0, then the Spinner control will index C1, and if A1=1 then the Spinner control will index cell C2. Is this possible? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bernie,
Thanks for the reply. I'm not sure I understand correctly. If I link to the cell that contains the formula the formula is overwritten by the spinner index value. Thanks BJ On Nov 19, 2:32 pm, "Bernie Deitrick" <deitbe @ consumer dot org wrote: BJ, ry linking the spinner to a cell with the formula =IF(A1=0,C1,C2) HTH, Bernie MS Excel MVP "BJ" wrote in message ... I searched through the forum but I can't find the solution I'm looking for. I want the Cell Link in a single Spinner control to depend on the value of another cell. In other words, if A1=0, then the Spinner control will index C1, and if A1=1 then the Spinner control will index cell C2. Is this possible? Thanks- Hide quoted text - - Show quoted text - |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
BJ,
I'm sorry - I wasn't thinking clearly, and was obviously confused ;-) Anyway, copy the code below, right click the sheet tab, select "View Code" and paste the code into the window that appears. Just change the name SpinButton1 to the name of the spin button of interest. HTH, Bernie MS Excel MVP Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim mySB As OLEObject Set mySB = Me.OLEObjects("SpinButton1") If Range("A1").Value = 0 Then mySB.LinkedCell = "C1" Else mySB.LinkedCell = "C2" End If End Sub "BJ" wrote in message ... Bernie, Thanks for the reply. I'm not sure I understand correctly. If I link to the cell that contains the formula the formula is overwritten by the spinner index value. Thanks BJ On Nov 19, 2:32 pm, "Bernie Deitrick" <deitbe @ consumer dot org wrote: BJ, ry linking the spinner to a cell with the formula =IF(A1=0,C1,C2) HTH, Bernie MS Excel MVP "BJ" wrote in message ... I searched through the forum but I can't find the solution I'm looking for. I want the Cell Link in a single Spinner control to depend on the value of another cell. In other words, if A1=0, then the Spinner control will index C1, and if A1=1 then the Spinner control will index cell C2. Is this possible? Thanks- Hide quoted text - - Show quoted text - |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
BJ,
One other thing.... If you are using a spinner from the Forms toolbar, then you would need to use this instead: Dim Shp As Shape Set Shp = Me.Shapes("Spinner 1") If Range("A1").Value = 0 Then Shp.ControlFormat.LinkedCell = "C1" Else Shp.ControlFormat.LinkedCell = "C2" End If HTH, Bernie MS Excel MVP "Bernie Deitrick" <deitbe @ consumer dot org wrote in message ... BJ, I'm sorry - I wasn't thinking clearly, and was obviously confused ;-) Anyway, copy the code below, right click the sheet tab, select "View Code" and paste the code into the window that appears. Just change the name SpinButton1 to the name of the spin button of interest. HTH, Bernie MS Excel MVP Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim mySB As OLEObject Set mySB = Me.OLEObjects("SpinButton1") If Range("A1").Value = 0 Then mySB.LinkedCell = "C1" Else mySB.LinkedCell = "C2" End If End Sub "BJ" wrote in message ... Bernie, Thanks for the reply. I'm not sure I understand correctly. If I link to the cell that contains the formula the formula is overwritten by the spinner index value. Thanks BJ On Nov 19, 2:32 pm, "Bernie Deitrick" <deitbe @ consumer dot org wrote: BJ, ry linking the spinner to a cell with the formula =IF(A1=0,C1,C2) HTH, Bernie MS Excel MVP "BJ" wrote in message ... I searched through the forum but I can't find the solution I'm looking for. I want the Cell Link in a single Spinner control to depend on the value of another cell. In other words, if A1=0, then the Spinner control will index C1, and if A1=1 then the Spinner control will index cell C2. Is this possible? Thanks- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Removing the constant link from Spinner | Excel Worksheet Functions | |||
Spinner, cell link and countif | Excel Discussion (Misc queries) | |||
conditional format if cell contains link to another cell | Excel Discussion (Misc queries) | |||
Use spinner to set a cell reference in a formula | Excel Programming | |||
automatically create a spinner and link it when a button is pressed | Excel Programming |