Using excel cell formatting, I've entered hundreds of vendors and their phone numbers into a spreadsheet.
I designed a macro to search the spreadsheet and put the results in a user form, with their names to be selected in a list box, and their phone numbers displayed in a label box.
Unfortunately, I can't figure out how to format the label box to get the phone number in the standard (###) ###-#### form (I typed them in without formatting at the time, letting the excel formatting do that for me).
It seems I should be able to use visual basic to do this, but I'm at a loss.
Private Sub LastNameListBox_Click()
Dim selectedRow As Long
selectedRow = LastNameListBox.ListIndex + 1
SelectedMainPhone = vendorData(selectedRow, 6)
MainPhone.Caption = SelectedMainPhone
Any help would be greatly appreciated.
I designed a macro to search the spreadsheet and put the results in a user form, with their names to be selected in a list box, and their phone numbers displayed in a label box.
Unfortunately, I can't figure out how to format the label box to get the phone number in the standard (###) ###-#### form (I typed them in without formatting at the time, letting the excel formatting do that for me).
It seems I should be able to use visual basic to do this, but I'm at a loss.
Private Sub LastNameListBox_Click()
Dim selectedRow As Long
selectedRow = LastNameListBox.ListIndex + 1
SelectedMainPhone = vendorData(selectedRow, 6)
MainPhone.Caption = SelectedMainPhone
Any help would be greatly appreciated.