[ 初めての方へ | 一覧(最新更新順) | 全文検索 | 過去ログ ]
『写真の貼り付け』(かごしま)
下記のようなマクロで写真帳を作成しています。
(A4に写真を3枚づつ貼り付け)
エクセル2007で作成していると、写真を貼り付けた後にコマンドボタンが写真の上に残ってしまいます。
エクセル2003では写真挿入後はコマンドボタンは消えているのですが、何故でしょうか?
Sub miko_test1()
Dim c As Range, cm As Range
Application.ScreenUpdating = False
For Each c In Selection
Set cm = c.MergeArea
If c.Address = cm.Item(1).Address Then
If Application.Dialogs(xlDialogInsertPicture).Show = False Then Exit Sub
With Selection
.Left = cm.Left
.Top = cm.Top
.Height = cm.Height
.Width = cm.Width
End With
End If
Next
Set cm = Nothing
Application.ScreenUpdating = True
End Sub
Sub miko_test1()
Dim c As Range, cm As Range
Application.ScreenUpdating = False
For Each c In Selection
Set cm = c.MergeArea
If c.Address = cm.Item(1).Address Then
If Application.Dialogs(xlDialogInsertPicture).Show = False Then Exit Sub
With Selection
.Left = cm.Left
.Top = cm.Top
.Height = cm.Height
.Width = cm.Width
.ShapeRange.ZOrder msoBringToFront 'これを追加してみては?
End With
End If
Next
Set cm = Nothing
Application.ScreenUpdating = True
End Sub
ichinose
[ 一覧(最新更新順) ]
YukiWiki 1.6.7 Copyright (C) 2000,2001 by Hiroshi Yuki.
Modified by kazu.