Excel VBA 質問スレ Part65at TECH
Excel VBA 質問スレ Part65 - 暇つぶし2ch373:デフォルトの名無しさん
20/04/16 15:11:15.02 xWZcVh5Wa.net
>>371
ネット丸パクリのコードだけど
Sub sample04()
Dim objShape As Object
Dim strPath As String, strFileName As String
Dim strImgName As String
strPath = "c:¥temp¥"
strFileName = Dir(strPath & "*.jpg")
Do Until Len(strFileName) = 0
strImgName = Left(strFileName, Len(strFileName) - 4)
Cells.Find(What:=strImgName).Activate
ActiveCell.Offset(0, 1).Activate
Set objShape = ActiveSheet.Shapes.AddPicture( _
Filename:=strPath & strFileName, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=ActiveCell.Left, _
Top:=ActiveCell.Top, _
Width:=ActiveCell.Width, _
Height:=ActiveCell.Height)
strFileName = Dir()
Loop
End Sub


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch