Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: dealing with autoshapes

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Here is a quick one for ya'

    how do you tell (using vba) if there is an autoshape above your cusor, ie, activecell.range("A1").select ...... does it have a shape above it?

    Ed??

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Good Luck On This One

    API??????????????????

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    yup.. it is a bit tricky... I challenge ya'

    Ed...

    can anyone resist a challenge??

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    How's this?

    Sub trythis()
    Dim sh As Object, flag As Boolean
    Dim r1%, r2%, c1%, c2%, acr%, acc%

    flag = False
    acc = ActiveCell.Column
    acr = ActiveCell.Row
    For Each sh In ActiveSheet.Shapes
    r1 = sh.TopLeftCell.Row
    r2 = sh.BottomRightCell.Row
    c1 = sh.TopLeftCell.Column
    c2 = sh.BottomRightCell.Column
    If (r1 <= acr And r2 >= acr And c1 <= acc And c2 >= acc) Then
    MsgBox "Autoshape " & sh.Name & " is over this cell"
    flag = True
    End If
    Next sh
    If Not (flag) Then MsgBox "No Autoshapes at this cell."
    Set sh = Nothing
    End Sub

    "Interfere? Of course we should interfere! Always do what you're best at, that's what I say!" -- The Doctor, Nightmare of Eden

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I like this... elegant yet simple...

    another of those, why didn't I think of that ..

    just to add an aditional question to the forum,

    If you have a timeline with filled autoshapes representing the location of a gas turbine, the rectangles are added by selecting a range and finding its locatin and size (top, left, height and width functoins) but it would be nice to update the rectangles so that if they were coded with some tag or another they automaticaly extended their length with the month....

    is this one asking too much??

    Ed...?

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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