question

EkerSelim-7878 avatar image
0 Votes"
EkerSelim-7878 asked EkerSelim-7878 answered

VBA, Userforms: selecting different Controls by name (for a loop)

Hello Everyone,

I just started to learn VBA for a project and i have a userform where i have multiple sliders that give me values that i want to use to build a 2D Array with For loops.

My Array is 5 by 5 and it is "Symmetric" (1 as diagonal, Thus I only need one side for the values).

I obtain the matrix values after converting values obtained from sliders in the GUI, which i named Sld1v2 (for row 1, col 2), Sld1v3 (for row1, col3) etccc.


I am thus looking for a way to call the right Slider (by its custom name) in the for loops but i cannot figure how i can do it, can you help me ?

Following you can see the Excel Version of what i want to code and my attempt of a script.
I hope my request is clear :)

100183-capture1.png


100185-capture2.png


office-vba-dev
capture1.png (51.5 KiB)
capture2.png (16.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

EkerSelim-7878 avatar image
0 Votes"
EkerSelim-7878 answered

Update: i used this line of code and it doesnt appear as red anymore. However i now get: type doesn't match. I have no idea what could be the potential issue :C


100245-capture3.png




capture3.png (16.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.