PC Review


Reply
Thread Tools Rate Thread

Conditional Cell Link in Spinner?

 
 
BJ
Guest
Posts: n/a
 
      19th Nov 2007
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
 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      19th Nov 2007
BJ,

ry linking the spinner to a cell with the formula

=IF(A1=0,C1,C2)

HTH,
Bernie
MS Excel MVP

"BJ" <(E-Mail Removed)> wrote in message
news:13813c94-34fc-46b7-949b-(E-Mail Removed)...
>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



 
Reply With Quote
 
BJ
Guest
Posts: n/a
 
      20th Nov 2007
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" <b...@favaro.net> wrote in message
>
> news:13813c94-34fc-46b7-949b-(E-Mail Removed)...
>
>
>
> >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 With Quote
 
Bernie Deitrick
Guest
Posts: n/a
 
      20th Nov 2007
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" <(E-Mail Removed)> wrote in message
news:0c845554-a711-4f73-a704-(E-Mail Removed)...
> 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" <b...@favaro.net> wrote in message
>>
>> news:13813c94-34fc-46b7-949b-(E-Mail Removed)...
>>
>>
>>
>> >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 With Quote
 
Bernie Deitrick
Guest
Posts: n/a
 
      20th Nov 2007
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
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:0c845554-a711-4f73-a704-(E-Mail Removed)...
>> 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" <b...@favaro.net> wrote in message
>>>
>>> news:13813c94-34fc-46b7-949b-(E-Mail Removed)...
>>>
>>>
>>>
>>> >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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing the constant link from Spinner aaminof@yahoo.com Microsoft Excel Worksheet Functions 1 1st Sep 2007 02:22 AM
Spinner, cell link and countif =?Utf-8?B?c2tld2V5?= Microsoft Excel Misc 2 26th Jan 2007 07:52 AM
conditional format if cell contains link to another cell Marcel Marien Microsoft Excel Misc 8 2nd Nov 2006 01:17 AM
conditional format if cell contains link to another cell Marcel Marien Microsoft Excel Discussion 3 2nd Nov 2006 12:28 AM
Link a Spinner to a combo box control Tim Microsoft Excel Discussion 2 28th Apr 2006 01:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:30 AM.