mellymelle
New Member
- Joined
- Nov 25, 2016
- Messages
- 45
Hello, trying to do the title task (in Phase 1 & 3 of code below), but getting the type mismatch error when running. Please help, thanks in advance!
Code:
Sub PhaseOne()
Application.ScreenUpdating = False
Call PhaseOneStepOne
Call PhaseOneStepTwo
Call PhaseOneStepThree
Application.ScreenUpdating = True
End Sub
Sub PhaseOneStepOne()
'From the file Performance template (Final).xlsx, Copy rows 36, 37 & 38 and INSERT copied rows into the active client sheet at row 36
Dim SourceFile As Workbook
Dim SourceSheet As Worksheet
Dim TargetFile As Workbook
Dim TargetSheet As Worksheet
Set SourceFile = "Performance Template (Final).xlsx"
Set TargetFile = ThisWorkbook
Set SourceSheet = SourceFile.Sheets("Template")
Set TargetSheet = TargetFile.Sheets("Template")
TargetSheet.rows("36:38").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
SourceSheet.rows("36:38").Copy
TargetSheet.Range("A36").PasteSpecial Paste:=xlPasteFormulas
End Sub
Sub PhaseOneStepTwo()
'Value paste rows 39,40 & 41 of the active client sheet
TargetSheet.rows("39:41").Copy
TargetSheet.Range("A39").PasteSpecial Paste:=xlPasteValues
End Sub
Sub PhaseOneStepThree()
'From the file Performance template (Final), Copy formulas in cells G7:G15 and PASTE formula into each individual client sheet at G7:G15
SourceSheet.Range("G7:G15").Copy
TargetSheet.Range("G7").PasteSpecial Paste:=xlPasteFormulas
End Sub