Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2006

Tip: Looking for answers? Try searching our database.

Spinner functionality

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mellowe - 20 Jan 2006 17:29 GMT
Hi All

I have a macro that allows me to enter spinners for a range of cells
(R7:R100)

The problem I have is I would like to format control them all in one
for each incremental cell value :

Current Value: 0
Maximum Value: 450
Incremental Change: 5
Cell Link Q7 through to Q100 respectively e.g. cell link R7 for Q7, R8
for Q8 etc

My Macro:

Sub insertspinners()
Dim mySPN As Spinner
   Dim myCell As Range
   With ActiveSheet
       .Spinners.Delete
       For Each myCell In ActiveSheet.Range("R7:R200").Cells
           With myCell
               Set mySPN = .Parent.Spinners.Add _
                               (Top:=.Top, Width:=.Width, _
                               Left:=.Left, Height:=.Height)

               End With

       Next myCell
   End With
End Sub

Is this possible?  
Thanks!
Dave Peterson - 20 Jan 2006 18:50 GMT
Just keep going with your code...

Option Explicit

Sub insertspinners()
Dim mySPN As Spinner
   Dim myCell As Range
   With ActiveSheet
       .Spinners.Delete
       For Each myCell In ActiveSheet.Range("R7:R200").Cells
           With myCell
               Set mySPN = .Parent.Spinners.Add _
                               (Top:=.Top, Width:=.Width, _
                               Left:=.Left, Height:=.Height)
               End With
               With mySPN
                   .Value = 0
                   .Max = 450
                   .SmallChange = 5
                   .LinkedCell = myCell.Offset(0, 1).Address(external:=True)
               End With
       Next myCell
   End With
End Sub

> Hi All
>
[quoted text clipped - 31 lines]
> Is this possible?
> Thanks!

Signature

Dave Peterson

mellowe - 23 Jan 2006 13:17 GMT
Brilliant Thanks Dave - I just wasn't sure how to put in that last
formatting bit, but works a dream...Thanks again!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.