| 
    
     |  | そもそも >エクセル上で読み込んだ案内図
 なら
 >案内図をパソコン画面一杯広げた
 というのは無理な注文なんで、あくまでエクセルに挿入した画像を対象に考えます。
 まず標準モジュールの先頭から、以下のマクロ全てを入れて下さい。
 
 Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
 Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
 
 Type POINTAPI
 x As Long
 y As Long
 End Type
 
 Sub MyPoint_Flash()
 Dim Poi As POINTAPI
 Dim MyX As Long, MyY As Long
 Dim i As Long
 Dim Px As Single, Py As Single
 
 GetCursorPos Poi
 MyX = Poi.x: MyY = Poi.y
 With ActiveWindow
 Px = (MyX - .PointsToScreenPixelsX(0)) * 0.75
 Py = (MyY - .PointsToScreenPixelsY(0)) * 0.75
 End With
 With ActiveSheet.Rectangles.Add(Px, Py, 10, 10).Interior
 .ColorIndex = 1
 For i = 1 To 20
 Sleep 250
 If .ColorIndex = 1 Then
 .ColorIndex = 6
 Else
 .ColorIndex = 1
 End If
 Next i
 End With
 ActiveSheet.Rectangles.Delete
 End Sub
 
 そしてシートに戻り、画像を右クリックして↑MyPoint_Flashをマクロ登録して下さい。
 画像上の任意の位置でクリックすると、そこへ四角(図形)を配置し、色を変えて点滅
 しているように見せる。という処理をします。点滅の回数はカウンタ変数 i の値を
 For 〜 Next文にて上限を変更して決めます。点滅の間隔は、Sleep関数の引数で
 決めます。1000 にするとちょうど 1秒 と考えて下さい。従って250なら 1/4秒です。
 また、図形の大きさは
 >With ActiveSheet.Rectangles.Add(Px, Py, 10, 10).Interior
 の、10(幅), 10(高さ) を変更して決めます。
 試してみて下さい。
 
 |  |