VBA | Dynamic range Filters in Excel | Automatic filter

VBA | Dynamic range Filters in Excel | Automatic filter

3,539 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Gerard van Eggermond
Gerard van Eggermond - 28.06.2023 10:58

Hello sir, maybe you can help me I made code in Vba but it is long now I would like to make it smaller
Here part of the code:
Application.ScreenUpdating = False
If Sheets("Menu").Range("E2") = 1 Then
Sheets("toplay1").Select
Range("A1").Select
ActiveCell.Formula2R1C1 = _
"=FILTER('S1'!R[1]C[1]:R[20]C[1],'S1'!R[1]C[1]:R[20]C[1]<>" "")"
Range("B1").Select
ActiveCell.Formula2R1C1 = _
"=FILTER('S1'!R[1]C[5]:R[20]C[5],'S1'!R[1]C[5]:R[20]C[5]<>" "")"
The Range continues until "J1" you also notice that at "c[ ] each time 4 are added, that is because the search area moves 4 columns each time, if you can help me with this I will be able to continue with the rest I think, can you help me PLEASE
What I forgot is that the number of rows being searched is 20.

Ответить
Dan
Dan - 16.03.2022 20:40

If I enter a value in textbox1 and then in textbox2 and then delete the value in textbox2 it triggers the error

Ответить