How To Loop Across Columns In VBA

preview_player
Показать описание
In this video we show you how to use VBA to loop through columns.

To get the code used in the video visit our website
Рекомендации по теме
Комментарии
Автор

Hello sir, maybe you can help me, I made a code but it is too long now I want to reduce it, is this possible? One section has the following code;
Application.ScreenUpdating = False
If Sheets("Menu").Range("E2") = 1 Then
Sheets("toplay1").Select
Range("A1").Select5
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]<>" "")"

This continues, at (c[ ]) each time 4 is added until 37 is reached
Could you help me?
Thanks in advance.

gerardvaneggermond
Автор

Hello sir, I found it interesting but I don't fully understand it, maybe you can help me, I made some code in VBA but it is quite long, I think through different loops it can be shortened. What do I want to do want to work with filters (10 columns and 20 rows, one row in between and then again), this for 2 different worksheets, Can you help me?
Thank you in advance;

gerardvaneggermond