I have this array of labels named lpr, similar:
lpr(0)
lpr(1)
ecc...
how to loop all label in array on a form and retrieve the tag string?
looping all label in array
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: looping all label in array
You can use
or
Code: Select all
Dim i As Long
For i = lpr.LBound To lpr.UBound
Debug.Print lpr(i).Tag
Next i
Code: Select all
Dim itm As Label
For Each itm In lpr
Debug.Print itm.Tag
Next itm
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: looping all label in array
HansV wrote: ↑06 Nov 2022, 12:35You can use
orCode: Select all
Dim i As Long For i = lpr.LBound To lpr.UBound Debug.Print lpr(i).Tag Next i
Code: Select all
Dim itm As Label For Each itm In lpr Debug.Print itm.Tag Next itm