mahmed1
Well-known Member
- Joined
- Mar 28, 2009
- Messages
- 2,302
- Office Version
- 365
- 2016
- Platform
- Windows
Hi All,
can you please advise why im getting an error
Im trying to pass a string address and then use that put it aint working
'Calling function
UpdatePCA ThisWorkbook.Worksheets("Calc").Range("PCA_CS"), "D7:K7"
can you please advise why im getting an error
Im trying to pass a string address and then use that put it aint working
'Calling function
UpdatePCA ThisWorkbook.Worksheets("Calc").Range("PCA_CS"), "D7:K7"
Code:
Private Sub UpdatePCA(PCA_File As String, PCA_Address As String)
Dim WeeklyReviewSh As Worksheet
Dim Lweek As Worksheet
Dim PCA_WB As Workbook
Set Lweek = ThisWorkbook.Worksheets("Last Week")
Application.ScreenUpdating = False
Set PCA_WB = Workbooks.Open(PCA_File, , True)
Set WeeklyReviewSh = PCA_WB.Worksheets("WeeklyReview")
'Actual PCA
>>>This is where i get an error Lweek.Range("PCA_Address").Value = WeeklySh.Range("C15:J15").Value
'Close File
PCA_WB .Close False
Application.ScreenUpdating = True
End Sub