Still doesn't seem to work for me. I am showing all of my code for this project to see if it is something else that is causing the problem. The Update_Link module works like it should, and so does the sort module as long as this spreadsheet is the open one. As soon as I open any other spreadsheet it now gives a stop 400 error.
Sub Update_Link()
'
'Update_Link Macro
'Dim r as starting row, cc as cell row, str1 as file location, str2-11 as cell location, nc as cell location
nc = 6
nc2 = 7
r = 50
str1 = Range("C3") + "Audit Form'!"
str2 = "$G$5"
str3 = "$N$5"
str4 = "$A$" & cc
str5 = "$B$" & cc
str12 = "$CQ$"
str14 = "$J$"
'Establish links to external spreadsheet
Range("C8") = "=" + str1 + str2
Range("C9") = "=" + str1 + str3
For cc = 10 To 43
Range("A" & r).Select
Range("A" & r) = "=" + str1 + str4 & cc
Range("C" & r) = "=" + str1 + str5 & cc
r = r + 1
Next cc
Range("F13") = "=" + str1 + str12 & nc
Range("F15") = "=" + str1 + str12 & nc2
'Initiate Sorting
Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkbook.Auto_sort"
'Set focus on primary sheet
Range("A1").Activate
End Sub
Sub Auto_Sort()
'
' Auto_Sort Macro
'
ThisWorkbook.Worksheets("Dashboard").Range("A50:C83").Sort key1:=Range("C50"), order1:=xlDescending, Header:=xlNo, DataOption1:=xlSortNormal
'Reset Auto_Sort counter
Application.OnTime Now + TimeValue("00:00:05"), "ThisWorkbook.Auto_sort"
Range("A1").Select
End Sub
I'm completely confused as to why it won't work. All of the code is in the "ThisWorkbook" section in VBA. Do the modules need to be seperated maybe?
Bookmarks