Hello;
I am trying to execute a sub on a sheet called FILTER from another worksheet called Summary in the same workbook with the following code :
P.S. I am also trying to refresh only one worksheet called Data but the only way I have found to do it is through RefreshAll
'**************************
'Trying to refresh the Data worksheet and execute the filter command on the filter worksheet
The sub code is (by the way this sub is working fine on its own) :
>>> 2nd time -- use code - tags <<<
But I get this error :
Anyone knows how to fix this?
Thank you for your time.
I am trying to execute a sub on a sheet called FILTER from another worksheet called Summary in the same workbook with the following code :
P.S. I am also trying to refresh only one worksheet called Data but the only way I have found to do it is through RefreshAll
'**************************
'Trying to refresh the Data worksheet and execute the filter command on the filter worksheet
Code:
Workbooks(ThisWorkbook.Name).RefreshAll
Call Sheets("FILTER").btnFiltre_Click
>>> 2nd time -- use code - tags <<<
Code:
Option Explicit
Private Sub btnFiltre_Click()
Dim zFirstColumn As String
Dim n As Long
ActiveWorkbook.Connections("LSUPRD.ZFRTCSV").Refresh
' clear old data first
zFirstColumn = "A"
n = Cells(Rows.Count, zFirstColumn).End(xlUp).Row
If n > 10 Then
Rows("11:" & CStr(n)).Delete Shift:=xlUp
End If
Call btnFilter(n)
End Sub
But I get this error :
Anyone knows how to fix this?
Thank you for your time.
Last edited by a moderator: