Hi everyone
I would like a series of labels to correspond to a series of cells
In a Form, arranged vertically, I have 7 series of 15 labels (eg. LblData1, lblData2 etc.)
So lblData1 = BA2, lblCod1 = BB2, lblPag1 = BC2, lblCmp1 = BD2, lblArt1 = BE2, lblQta1 = BL2, lblSub1 = BS2
so far I have only managed to display the first line correctly (BA2 => BS2)
but not the others below
(BA3 => BS3), (BA4 => BS4), etc.
This is the code:
How to also display the entries in Rows 3,4,5, etc.
I would like a series of labels to correspond to a series of cells
In a Form, arranged vertically, I have 7 series of 15 labels (eg. LblData1, lblData2 etc.)
So lblData1 = BA2, lblCod1 = BB2, lblPag1 = BC2, lblCmp1 = BD2, lblArt1 = BE2, lblQta1 = BL2, lblSub1 = BS2
so far I have only managed to display the first line correctly (BA2 => BS2)
but not the others below
(BA3 => BS3), (BA4 => BS4), etc.
This is the code:
VBA Code:
Dim x, y, w, j, k, x1, y1
Dim LastRow1 As Long
LastRow1 = Sheets("Dati").Cells(Rows.Count, "BA").End(xlUp).Row
For x = 1 To 15
Me.Controls("lblData" & x).Caption = Range("BA1").Offset(x, 0).Value
Exit For
Next x
For y = 1 To 15
Me.Controls("lblPag" & y).Caption = Range("BC1").Offset(y, 0).Value
Exit For
Next y
For w = 1 To 15
Me.Controls("lblCmp" & w).Caption = Range("BD1").Offset(w, 0).Value
Exit For
Next w
For j = 1 To 15
Me.Controls("lblCod" & j).Caption = Range("BB1").Offset(j, 0).Value
Exit For
Next j
For k = 1 To 15
Me.Controls("lblArt" & k).Caption = Range("BE1").Offset(k, 0).Value
Exit For
Next k
For x1 = 1 To 15
Me.Controls("lblQta" & x1).Caption = Range("BL1").Offset(x1, 0).Value
Exit For
Next x1
For y1 = 1 To 15
Me.Controls("lblSub" & y1).Caption = Range("BS1").Offset(y1, 0).Value
Exit For
Next y1
How to also display the entries in Rows 3,4,5, etc.