Option Explicit
Sub MiniScreenShotShortCut()
Application.MacroOptions Macro:="HeightBaseMiniScreenShot", ShortcutKey:="e"
Application.MacroOptions Macro:="WidthBaseMiniScreenShot", ShortcutKey:="E"
End Sub
Sub HeightBaseMiniScreenShot()
Dim expectHeight As Double
'リサイズ後のスクショの高さ
expectHeight = 500
Dim cbfs As Variant
cbfs = Application.ClipboardFormats
If cbfs(1) = xlClipboardFormatBitmap Or cbfs(1) = xlClipboardFormatPICT Then
ActiveSheet.Paste
Selection.Height = expectHeight
Dim moveCount As Integer
moveCount = Selection.Height \ ActiveCell.RowHeight + 1
ActiveCell.Offset(moveCount, 0).Activate
End If
End Sub
Sub WidthBaseMiniScreenShot()
Dim expectWidth As Double
'リサイズ後のスクショの幅
expectWidth = 500
Dim cbfs As Variant
cbfs = Application.ClipboardFormats
If cbfs(1) = xlClipboardFormatBitmap Or cbfs(1) = xlClipboardFormatPICT Then
ActiveSheet.Paste
Selection.Width = expectWidth
Dim moveCount As Integer
moveCount = Selection.Height \ ActiveCell.RowHeight + 1
ActiveCell.Offset(moveCount, 0).Activate
End If
End Sub
Ctrl + E で高さ固定、Ctrl + Shift + E で幅固定でクリップボードに入っている画像をリサイズして貼り付けられます。
個人的な都合でリサイズしたスクショを貼り付けたときにフォーカスをスクショの高さだけ下に移動させています。邪魔なら消してください。