How to overcome error: 1004 - autofill method of range class failed using Excel VBA?
Please note following code and values of variables are remarked below:
How do I change it to accept what I'm trying to accomplish?
Basically the range: C39 contains the formula -> =SUM(C7:C38) and want to copy that across Range D39:N39 where it can total those different columns in similar fashion.
Dim selection1 As Range
Dim selection2 As Range
'sColLetterStart = "C"
Set selection1 = m_xlSheet.Range(sColLetterStart & "39")
'sTotalCompleteRange = "D39:N39"
Set selection2 = m_xlSheet.Range(sTotalCompleteRange)
selection1.AutoFill Destination:=selection2 ', Type:=xlFillDefault
Set selection2 = Nothing
Set selection1 = Nothing