PDA

View Full Version : Using "For Next" to a button name



ferrugo
10-22-2010, 11:45 AM
Hello,

Fristly, sorry me for the poor english.

Here are a question that i have.. I seach in the forum but find nothing.

I want something like that...

Quant = 50

For i = 1 To Quant
Namebt = "butoon" & i
Userform1.Namebt.Caption = Sheets(1).Cells(i, 2).Value
Next i

As you see, the command "for" select the Button... after that i change the Caption.

Thanks so much...
:banghead: :dunno :( :doh: : pray2: :mkay

mdmackillop
10-22-2010, 12:06 PM
Try
Userform1.Controls(Namebt).Caption

ferrugo
10-22-2010, 12:15 PM
thksssss.....
for the answer...
Works like a charm..
Thank so much...
:rofl: :rotlaugh: :clap: :clap: :clap: :clap: :clap: :thumb