Userform comobox equal to first 3 digits in a cell

S

Shawn

A cell in a sheet contanins a 10 digit phone number -
WSCal.Range("Phone_Number")

I have a userform with two combo boxes and a text box.

I want the first combo box to load with the first 3 digits from
WSCal.Range("Phone_Number")

This don't work: .cmbxPhoneArea.Value = Left("WSCal.Range("Phone_Numer")", 3)


Then second combo box should load with the 4th 5th and 6th digits

And the textbox should load with the last 4 digits.

???
 
J

Joel

The problem is the cell reference
"WSCal.Range("Phone_Numer")"
You don't need the double quotes. Is "NUMBER" spelled correctly? You should
also add value because a range may be multiple cells.

..cmbxPhoneArea.Value = Left(WSCal.Range("Phone_Numer").value, 3)
 
S

Shawn

Number wasn't spelled correctly and I would have been scratching my head over
that for a bit.
 
S

Shawn

So what is wrong with this?

.cmbxPhonePre.Value = Mid(WSSCal.Range("Phone_Number").Value, 4, 3)
 
R

Rick Rothstein \(MVP - VB\)

So what is wrong with this?
.cmbxPhonePre.Value = Mid(WSSCal.Range("Phone_Number").Value, 4, 3)

The extra "S" you added to WSCal?

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top