Results 1 to 9 of 9

Clickable annual wheel

Threaded View

daredan Clickable annual wheel 08-26-2014, 05:32 AM
LJMetzger Re: Clickable annual wheel 08-26-2014, 08:49 AM
daredan Re: Clickable annual wheel 08-26-2014, 09:20 AM
daredan Re: Clickable annual wheel 08-26-2014, 09:57 AM
daredan Re: Clickable annual wheel 08-27-2014, 04:12 AM
LJMetzger Re: Clickable annual wheel 08-27-2014, 10:20 AM
daredan Re: Clickable annual wheel 08-28-2014, 02:55 AM
lancer102rus Re: Clickable annual wheel 08-28-2014, 05:44 AM
daredan Re: Clickable annual wheel 08-28-2014, 08:25 AM
  1. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Clickable annual wheel

    Hi daredan,

    I love your wheel. Try the attached file. However, I didn't implement the year part, because I didn't see any Year segments.

    This is how I approached your problem:
    a. Macro 'RenameAciveShape()' was used to rename the segments to 'Jan' thru 'Dec'.
    b. Macro 'AssignOnActionTextToWheelSegments()' was used to assign Macro 'WheelEventHandler()' as the Event Handler for all Shapes on the Sheet.
    c. Macro 'WheelEventHandler()' processes CLICKS on the Wheel and puts the month in cell 'H1'.

    Code follows (ordinary code module such as 'Module1'):
    Option Explicit
    
    Sub AssignOnActionTextToWheelSegments()
      'This assigns macro 'WheelEventHandler' as the Event Handler for all Shapes on the Sheet
      
      Dim Sh As Object
        
      For Each Sh In ActiveSheet.Shapes
        Sh.OnAction = "WheelEventHandler"
      Next Sh
      
    End Sub
    
    Sub RenameAciveShape()
    
      Dim sNewName As String
      
      sNewName = InputBox("Enter a 3 letter month then select 'OK'", "Rename Wheel Segment Input Box")
    
      Selection.ShapeRange.Name = sNewName
    
    End Sub
    
    
    
    Sub WheelEventHandler()
      'This is the Wheel Segment Event Handler that assigns a month to cell 'H1'
      
      Dim bHaveValidMonth As Boolean
    
      Dim sMonth As String
      Dim sUpperCaseMonth As String
    
      'Get the name of the Shape that was selected
      'Debug.Print Application.Caller
      sMonth = Application.Caller
      sUpperCaseMonth = UCase(sMonth)
    
      'Test to see if the Shape selected was a month
      Select Case sUpperCaseMonth
        Case "JAN"
          bHaveValidMonth = True
        Case "FEB"
          bHaveValidMonth = True
        Case "MAR"
          bHaveValidMonth = True
        Case "APR"
          bHaveValidMonth = True
        Case "MAY"
          bHaveValidMonth = True
        Case "JUN"
          bHaveValidMonth = True
        Case "JUL"
          bHaveValidMonth = True
        Case "AUG"
          bHaveValidMonth = True
        Case "SEP"
          bHaveValidMonth = True
        Case "OCT"
          bHaveValidMonth = True
        Case "NOV"
          bHaveValidMonth = True
        Case "DEC"
          bHaveValidMonth = True
      End Select
    
      'If the shape selected was a month, then assign the value to cell 'H1'
      If bHaveValidMonth = True Then
        ActiveSheet.Range("H1").Value = sMonth
      End If
      
    End Sub
    Lewis
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cells not clickable
    By rageshprasad in forum Excel General
    Replies: 5
    Last Post: 05-15-2014, 07:52 PM
  2. Replies: 1
    Last Post: 05-07-2014, 06:19 PM
  3. Clickable Counter
    By samwright in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-30-2013, 09:49 AM
  4. Calculating Average Annual Returns from a Series of Annual Returns
    By Bruinsfan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-03-2012, 09:50 PM
  5. clickable buttons
    By Murph in forum Excel General
    Replies: 2
    Last Post: 06-22-2005, 03:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1