wanted a code that returns in EQL string in Label1.caption the objects that the Shapes ("a") is touching (separated by ",") example of how Label1.caption will get: "a":"blocka, blockb"; // "a" is touching blocka and blockb
thx
Here you go:
Label1.Caption = "" Dim shp As Shape, str As String: str = """a"":""" For Each shp In Shapes.Range If shp.Name <> "a" And shp.Left + shp.Width > Shapes("a").Left And shp.Left < Shapes("a").Left + Shapes("a").Width And _ shp.Top + shp.Height > Shapes("a").Top And shp.Top < Shapes("a").Top + Shapes("a").Height Then str = str & shp.Name & ", " Next If str <> """a"":""" Then str = Left(str, Len(str) - 2) str = str & """" Label1.Caption = str
Feel free to ask any question you may have :)