C
CrankyLemming
Hi
I hope I can explain this okay.
I have a userform which contains several labels whose captions are
taken from various cells on a sheet, activated by a 'Details' command
button.
The trouble is, not every is used every time. For example, the cells
have address line 1, line 2, line 3, postcode, phone number, fax
number; in cases where there isn't a fax number, I'm getting the
return "0".
I've tried to remedy this by putting the following code in the
("Details")button_click event:
For Each cntrl In UserForm1.Controls
If TypeOf cntrl Is MSForms.Label And Caption = "0" Then
Caption = ""
End If
.... but am still getting the zero return. Basically, I want the label
to be 'empty' or blank on screen if there is no data to fill it.
Am I missing something really obvious?
TIA
Steve
I hope I can explain this okay.
I have a userform which contains several labels whose captions are
taken from various cells on a sheet, activated by a 'Details' command
button.
The trouble is, not every is used every time. For example, the cells
have address line 1, line 2, line 3, postcode, phone number, fax
number; in cases where there isn't a fax number, I'm getting the
return "0".
I've tried to remedy this by putting the following code in the
("Details")button_click event:
For Each cntrl In UserForm1.Controls
If TypeOf cntrl Is MSForms.Label And Caption = "0" Then
Caption = ""
End If
.... but am still getting the zero return. Basically, I want the label
to be 'empty' or blank on screen if there is no data to fill it.
Am I missing something really obvious?
TIA
Steve