BrianWilson
Programmer
Hi all,
Hoping you can assist, I'm all out on ideas!
I have a Sub in a module which calls Subs on individual sheets. The Sub in the individual sheets needs to clear a range of cells, but I do not wish the focus to change to any of these sheets from the one the user is viewing. (Note: the Subs are executed via a timer routine).
The issue I am facing is that ClearContents requires the range/sheet to be selected, causing focus to be changed. ScreenUpdating does not help. Here are the code snippets:
Module Code
Sheet Code:
Any ideas?
Regards
BW
Hoping you can assist, I'm all out on ideas!
I have a Sub in a module which calls Subs on individual sheets. The Sub in the individual sheets needs to clear a range of cells, but I do not wish the focus to change to any of these sheets from the one the user is viewing. (Note: the Subs are executed via a timer routine).
The issue I am facing is that ClearContents requires the range/sheet to be selected, causing focus to be changed. ScreenUpdating does not help. Here are the code snippets:
Module Code
Code:
Sub GetPositions()
Application.ScreenUpdating = False
Application.EnableEvents = False
Call RETU.SendQuery
Call FINU.SendQuery
' etc.
' etc.
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Sheet Code:
Code:
Public Sub SendQuery()
Dim delay As String
Dim uname As String
Sheets("RETU").Activate
Range("A7", "L1000").ClearContents
' code snipped, but essentially ActiveX call
' inform user of update:
RETU.Cells(1, 3) = "Last update : " + CStr(Now())
End Sub
Any ideas?
Regards
BW