View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Brett Brett is offline
external usenet poster
 
Posts: 113
Default Variable Control name

Hi Rick, thanks for that, works like a charm. Are you suggesting that the
code could be simpler "(if you want)"? Regards, Brett

"Rick Rothstein" wrote:

While the UserForm is the default object for all controls on it (meaning you
don't have to qualify the control), you can do it (if you want) this way...

Set TBC = UF0_QCP.Controls(tb)

Note: Controls is a property of the UserForm

--
Rick (MVP - Excel)


"Brett" wrote in message
...
Hi there, I have a sub which gets the value of a Userform (name UF0_QCP)
control name passed into it (tb) but I'm having a little difficulty with
the
syntax:

Dim TBC As control
Set TBC = Controls("UF0_QCP." & tb)

What is the missing link please? Regards, Brett