マクロでもいいとのことなので。
実はもっと短くなるのかもしれませんが。
Dim Lcel As Integer
Dim Rcel As Integer
Dim Tcel As Integer
Dim Bcel As Integer
Sub CPcolr()
Lcel = Selection.Column '選択された範囲の左端
Tcel = Selection.Row ' 〃 上端
Rcel = Lcel + Selection.Columns.Count - 1 ' 〃 右端
Bcel = Tcel + Selection.Rows.Count - 1 ' 〃 下端
Selection.Copy
End Sub
Sub PTcolr()
Dim L2 As Integer
Dim T2 As Integer
L2 = Selection.Column '選択された範囲の左端
T2 = Selection.Row ' 〃 上端
Selection.PasteSpecial Paste:=1
Application.CutCopyMode = False
Range(Cells(Tcel, Lcel), Cells(Bcel, Rcel)).Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
Cells(T2, L2).Select
End With
End Subこんな感じで、それぞれ「CPcolr」と「PTcolr」をボタンもしくはショートカットに割り付けて下さい。
貼り付けのオプション指定は現在「全て」になっていますが、
値のみ等、形式を選択して貼り付けに対応できます。
現在の色設定は黄色になっています。
お礼
imogasiさんありがとうございました。 オートシェイプで見えないボタンを作り、コピー元の隣のセルの文字にかぶせておき、そのボタンに「着色」と「セルデータのコピー」をマクロ登録することにしました。 もし、もっと良い方法にお気づきでしたら教えてください。