1

選択したセルを参照して画像を挿入し、必要に応じてサイズを変更できます。問題は、同僚に Excel ファイルを電子メールで送信したときに、画像ファイルへのパスが彼らの PC にないため、画像が表示されないことです。これが私が使用しているコードで、キーボード ショートカット Ctrl-i で呼び出します。

Public Sub InsertAndResize()
CellWidth = Selection.Width
CellHeight = Selection.Height
CellLeft = Selection.Left
CellTop = Selection.Top
ActiveSheet.Pictures.Insert( _
Application.GetOpenFilename( _
"JPG picture files (*.jpg),*.jpg", , "Select the picture")).Select
Selection.ShapeRange.Width = CellWidth
If Selection.ShapeRange.Height > CellHeight Then Selection.ShapeRange.Height = CellHeight
With Selection
    .Height = Selection.ShapeRange.Height - 4
    .Width = Selection.ShapeRange.Width - 4
    .Left = CellLeft + ((CellWidth - .Width) / 2)
    .Top = CellTop + ((CellHeight - .Height) / 2)
End With
End Sub

セルに画像を挿入/貼り付け、ソース ファイルへのリンクを削除または解除して、他のユーザーがファイルのコピーを開いたときに表示できるようにするにはどうすればよいですか?

ご提案いただきありがとうございます。スティーブ

4

1 に答える 1

0

image links画像をcell name

于 2013-02-01T17:17:37.837 に答える