Hello,
I have a spreadsheet that imports data from another spreadsheet. The user can then print off a control sheet using this data. In the most part the code works fine most users can use the spreadsheet issue free, however there is one user who keeps having problems, every time they run the spreadsheet they get a subscript out of range error. The error is always with the background sheet select.
Does anyone have any ideas why this would be happening?
Thanks in advance
I have a spreadsheet that imports data from another spreadsheet. The user can then print off a control sheet using this data. In the most part the code works fine most users can use the spreadsheet issue free, however there is one user who keeps having problems, every time they run the spreadsheet they get a subscript out of range error. The error is always with the background sheet select.
Code:
Sub Fix_Background_Worksheet()
'
' Macro2 Macro
'
Workbooks(1).Activate
Sheets("background").Select
Range("A2").Select
ActiveCell.Replace What:="=SUM(#REF", Replacement:="=SUM('import data'", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:= _
False, ReplaceFormat:=False
Cells.Find(What:="=SUM(#REF", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Cells.Replace What:="=SUM(#REF", Replacement:="=SUM('import data'", LookAt _
:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
Does anyone have any ideas why this would be happening?
Thanks in advance