View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
DennisE DennisE is offline
external usenet poster
 
Posts: 66
Default Common format for Labels in Userform

Edgar,

I do virtually the same thing as you. The trick is to change the label names
from whatever they are to Label001 to Label160.
Suppose the respective label captions are contained in Sheet1 from Cell A1
through A160. In a VBA code module introduce

Sub MyLabels()
Dim ctl As Control, J As Variant
For each ctl in MyUserForm
If TypeName(ctl) = "Label" then
J = Right(ctl.Name, 3)
ctl.Caption = Sheets("Sheet1") _ .Range("A1").Offset(J - 1).Value
ctl.Caption = _
Format(ctl.Caption, "#,##0.00")
End If
Next ctl
End Sub

-- Dennis Eisen