Many, many thanks to VoG for the following Macro :
Sub Copy_Formula()
'
' Copy_Formula Macro
' Macro recorded 04/05/2011 by Littlefair
'
'
Dim LR As Long
LR = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row - 1
Range("R11:AQ11").Copy
Range("R12:AQ" & LR).PasteSpecial Paste:=xlFormulas
Application.CutCopyMode = False
End Sub
However, I am trying to have it run when a tab is selected. I have amended to the following to copy the formula on the sheet as shown, but it does not run to the bottom as the Picture allocated one does.
Where have I gone wrong please and how do I get it to work?
Thanking in advance for any assistance
Sub Copy_Formula()
'
' Copy_Formula Macro
' Macro recorded 04/05/2011 by Littlefair
'
'
Private Sub Worksheet_Activate()
Dim LR As Long
LR = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row - 1
Sheets("VTC Detailed").Range("R11:AQ11").Copy
Application.EnableEvents = False
Sheets("VTC Detailed").Range("R12:AQ188").PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("VTC M&E Summary").Activate
Application.EnableEvents = True
End Sub
Sub Copy_Formula()
'
' Copy_Formula Macro
' Macro recorded 04/05/2011 by Littlefair
'
'
Dim LR As Long
LR = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row - 1
Range("R11:AQ11").Copy
Range("R12:AQ" & LR).PasteSpecial Paste:=xlFormulas
Application.CutCopyMode = False
End Sub
However, I am trying to have it run when a tab is selected. I have amended to the following to copy the formula on the sheet as shown, but it does not run to the bottom as the Picture allocated one does.
Where have I gone wrong please and how do I get it to work?
Thanking in advance for any assistance
Sub Copy_Formula()
'
' Copy_Formula Macro
' Macro recorded 04/05/2011 by Littlefair
'
'
Private Sub Worksheet_Activate()
Dim LR As Long
LR = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row - 1
Sheets("VTC Detailed").Range("R11:AQ11").Copy
Application.EnableEvents = False
Sheets("VTC Detailed").Range("R12:AQ188").PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("VTC M&E Summary").Activate
Application.EnableEvents = True
End Sub