I am trying to copy a set of cells based on the active cell when the user hits the macro shortcut key. For example, they have AI10 (R10C35) selected, I want it to copy the range R10C36:R22C79 Then paste values to R11C36:R23C79. The end of the range to copy will always be R22C79, and the end of the paste will always be R23C79. The start of the range is the only thing that varies based on the active cell.
If I can get the help to select the range and get it to copy, I can figure out the PasteRange and HolidayRange from there.
I'm sure my If statements could be simplified too, and open to constructive criticism on those as well, but the string to range is my main objective because the rest works as is.
As I currently have this, I get:
Runtime Error 1004
Method 'Range' of object '_Global' failed
Thanks!
Dim CurrentColumn As Integer
Dim CopyRange As String
Dim PasteRange As String
Dim HolidayRange As String
CurrentRow = ActiveCell.Row
CurrentColumn = ActiveCell.Column
If CurrentColumn <> "35" Then MsgBox ("You must select a date in column AI")
If CurrentRow < 9 Then MsgBox ("You must select a date in column AI")
If CurrentRow > 22 Then MsgBox ("You must select a date in column AI")
If CurrentColumn <> "35" Then Exit Sub
If CurrentRow < 9 Then Exit Sub
If CurrentRow > 22 Then Exit Sub
CopyRange = "R" & CurrentRow & "C" & CurrentColumn + "1" & ":R22C79"
PasteRange = "R" & CurrentRow + "1" & "C79" & ":R23C79"
Range(CopyRange).Select
Selection.Copy
Range(PasteRange).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
HolidayRange = "R" & CurrentRow & "C36:R" & CurrentRow & "C79"
Range(HolidayRange).ClearContents