I have been attempting for some time to automate compiling weekly reports that I receive. The following is what I have written, and I can't figure out why it doesn't update the value of cell B39 to reflect to the newly received sheet. This macro runs fine through to the range("B39").Value command, and then quits without updating that cell. If I quote out the rest of the macro and do just the value change to B39 then it works, but when put together it doesn't.
' tsadd Macro
'
'
' Worksheets("TOTALS").Activate
'previous:
Sheets(ActiveSheet.Index - 1).Activate
' On Error GoTo finish
Rows("39:39").Select
Application.CutCopyMode = False
Selection.Copy
Selection.Insert Shift:=xlDown
On Error Resume Next
Application.CutCopyMode = True
Range("b39").Value = "=T('g:Users:Google Drive:ST:SHEETS:[" & "ActiveSheet.Name " & Range("f39").Value & ".xls]sheet1'!$B$41:$I$57')"
On Error Resume Next
' GoTo previous
'finish:
End Sub
' tsadd Macro
'
'
' Worksheets("TOTALS").Activate
'previous:
Sheets(ActiveSheet.Index - 1).Activate
' On Error GoTo finish
Rows("39:39").Select
Application.CutCopyMode = False
Selection.Copy
Selection.Insert Shift:=xlDown
On Error Resume Next
Application.CutCopyMode = True
Range("b39").Value = "=T('g:Users:Google Drive:ST:SHEETS:[" & "ActiveSheet.Name " & Range("f39").Value & ".xls]sheet1'!$B$41:$I$57')"
On Error Resume Next
' GoTo previous
'finish:
End Sub