+ Reply to Thread
Results 1 to 2 of 2

Circled Number Question

  1. #1
    Registered User
    Join Date
    02-17-2005
    Posts
    20

    Circled Number Question

    I am creating an excel spreadsheet that will be used as an instruction template. The form needs to have circled numbers on the form that then refer to the numbered instruction on the right side of the page. I have looked through the drawing template and did not find anything that worked. Is there anyway to create a circled number that can be placed anywhere on the spreadsheet?

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Had the same problem several years ago ...

    Sub PutCircleAround()
    Const SCALER As Double = 1.2
    Dim myCircle As Shape
    Dim myWidth As Integer
    Dim myLeft As Integer
    Dim target As Excel.Range

    Set target = ActiveCell
    With target
    If .Count > 1 Then Exit Sub
    On Error Resume Next 'If already circled, Exit
    Set myCircle = ActiveSheet.Shapes( _
    "Circle_" & target.Address(0, 0))
    If Not myCircle Is Nothing Then Exit Sub
    On Error GoTo 0
    'Put the left at 1/2 the Scaled width from cell center
    'unless it would be to the left of the left sheet boundary
    myLeft = Application.Max(1, .Left + .Width * (1 - SCALER) / 2)
    'Set the width from myLeft to 1/2 Scaled width from cell ctr
    myWidth = (.Left + .Width * (1 + SCALER) / 2) - myLeft
    Set myCircle = ActiveSheet.Shapes.AddShape( _
    msoShapeOval, myLeft, .Top, myWidth, .Height)
    With myCircle
    .Name = "Circle_" & target.Address(0, 0)
    .Placement = xlMoveAndSize
    .Fill.Transparency = 1
    .Line.Weight = 3
    .Line.ForeColor.SchemeColor = 10
    End With
    End With
    End Sub


    HTH
    Cheers
    Carim

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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