I'm using Office 2016
And these are all the codes that are written in the file. In the end I want to run them all using menu buttons.
Option Explicit
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address <> "$AR$8" Then End 'Stop all running code
End Sub
Sub samT (control As IRibbonControl)
Dim Sht As Object
Do
For Each Sht In ThisWorkbook.Sheets
Sht.Activate
Range("AR8").Select
If Sht Is Sheets(1) Then
With ActiveWindow
.ScrollColumn = 1
.SmallScroll Down:=-100
Application.Wait (Now + TimeValue("00:00:03"))
DoEvents
.ScrollColumn = 1
.SmallScroll Down:=-100
.SmallScroll Down:=34
Application.Wait (Now + TimeValue("00:00:03"))
DoEvents
.ScrollColumn = 1
.SmallScroll Down:=-100
.SmallScroll Down:=68
Application.Wait (Now + TimeValue("00:00:03"))
DoEvents
End With
End If
If Sht Is Sheets(2) Then
With ActiveWindow
.ScrollColumn = 1
.SmallScroll Down:=-100
Application.Wait (Now + TimeValue("00:00:03"))
DoEvents
.ScrollColumn = 1
.SmallScroll Down:=-100
.SmallScroll Down:=34
Application.Wait (Now + TimeValue("00:00:03"))
DoEvents
DoEvents
End With
End If
Next
Loop
End Sub
Sub License_Filter(control As IRibbonControl)
'
' License_Filter מאקרו
'
'
ActiveWorkbook.Worksheets("רכבי אוצר").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("רכבי אוצר").AutoFilter.Sort.SortFields.Add Key:= _
Range("I3:I98"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("רכבי אוצר").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Sub Test_Filter(control As IRibbonControl)
'
' Test_Filter מאקרו
'
ActiveWorkbook.Worksheets("רכבי אוצר").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("רכבי אוצר").AutoFilter.Sort.SortFields.Add Key:= _
Range("H3:H98"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("רכבי אוצר").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
From what I noticed, what causes the problem is the code that stops the loop of the endless code running in the background - the first code I added here that you wrote me a few weeks ago.
Can you change it to different version?