macro to compile weekly sheets

gregsb

New Member
Joined
Jul 13, 2015
Messages
1
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
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,216,438
Messages
6,130,632
Members
449,584
Latest member
c_clark

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top