![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 81
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Good Luck On This One
API?????????????????? |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 81
|
yup.. it is a bit tricky... I challenge ya'
Ed... can anyone resist a challenge?? |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Posts: 74
|
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 |
|
Board Regular
Join Date: Mar 2002
Posts: 81
|
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...? |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|