Bonjour a tous,
Je rencontre actuellement un petit soucis sur mon algo VBA.
Celui ci fonctionne correctement mais j'aimerais empêcher qu'il change de feuille lors de son exécution ou juste masquer ce changement de feuille.
Ci-joint l'algo
Cordialement
Sub Refresh()
Dim addIn As COMAddIn
Dim automationObject As Object
Dim wsDatas As Worksheet
Dim wsTDB As Worksheet
Dim MyRange1 As Range
Dim MyRange2 As Range
Set addIn = Application.COMAddIns("PI DataLink")
Set automationObject = addIn.Object
Set wsDatas = ThisWorkbook.Worksheets("DATAS")
Set wsTDB = ThisWorkbook.Worksheets("TDB")
Set MyRange1 = wsDatas.Range("R30")
Set MyRange2 = wsDatas.Range("T30")
Application.ScreenUpdating = False
wsTDB.Range("P1").Calculate
If (Left(Worksheets("TDB").Range("P1"), 4) = "BT >") Then
'Application.ScreenUpdating = False
wsDatas.Range("A1:B2,C2:V2").Calculate
wsTDB.Range("A11:B22").Calculate
wsDatas.Range("B4:B16").Calculate
With wsDatas
.Select
With MyRange1
.Select
automationObject.SelectRange
automationObject.ResizeRange
End With
With MyRange2
.Select
automationObject.SelectRange
automationObject.ResizeRange
End With
End With
wsTDB.Select
Else
End If
Application.Calculation = xlCalculationAutomatic
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = True
End Sub