[過去ログ]
VBAなんでも質問スレ Part2 [転載禁止]©2ch.net (1002レス)
VBAなんでも質問スレ Part2 [転載禁止]©2ch.net http://mevius.5ch.net/test/read.cgi/tech/1432173164/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
272: デフォルトの名無しさん [sage] 2017/02/26(日) 14:44:16.79 ID:nMuhJunv エクセルのマクロでも質問大丈夫でしょうか? 名前と同じファイル名の画像を名前セルの隣に貼り付けるプログラムなんですが Sub ボタン1_Click() Const n As Long = 2 Dim i As Long Dim x As Double Dim s As String Dim t As FileDialog Dim m As VbMsgBoxResult With ActiveSheet For i = 2 To .Cells(.Rows.Count, 2).End(xlUp).Row Step 6 Set r = .Cells(i, 3).MergeArea s = "D:\画像\1\" & .Cells(i, 2).Value & ".jpg" Dir Application.Path With .Pictures.Insert(s).ShapeRange .LockAspectRatio = msoTrue x = Application.Min(r.Width / .Width, (r.Height - n) / .Height) .Width = .Width * x .Left = r.Left + (r.Width - .Width) / 2 .Top = r.Top + (r.Height - .Height) / 2 End With Next End With End Sub この"D:\画像\1\"の部分をフォルダ選択できるようにしたいので Dim s As String Dim t As FileDialog Set t = Application.FileDialog(msoFileDialogFolderPicker) s = "t" & .Cells(i, 2).Value & ".jpg" としたら「1004 PicturesクラスのInsertプロパティを取得できません。」と実行できません どうしたら"D:\画像\1\"の部分をフォルダ選択できるようにできるのでしょうか?ご教示お願い致します。 http://mevius.5ch.net/test/read.cgi/tech/1432173164/272
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 730 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.013s