ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform comobox equal to first 3 digits in a cell (https://www.excelbanter.com/excel-programming/392332-userform-comobox-equal-first-3-digits-cell.html)

Shawn

Userform comobox equal to first 3 digits in a cell
 
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.

???

--
Thanks
Shawn

joel

Userform comobox equal to first 3 digits in a cell
 
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)

"Shawn" wrote:

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.

???

--
Thanks
Shawn


Shawn

Userform comobox equal to first 3 digits in a cell
 
Number wasn't spelled correctly and I would have been scratching my head over
that for a bit.
--
Thanks
Shawn


"Joel" wrote:

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)

"Shawn" wrote:

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.

???

--
Thanks
Shawn


Shawn

Userform comobox equal to first 3 digits in a cell
 
So what is wrong with this?

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

--
Thanks
Shawn


"Joel" wrote:

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)

"Shawn" wrote:

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.

???

--
Thanks
Shawn


Rick Rothstein \(MVP - VB\)

Userform comobox equal to first 3 digits in a cell
 
So what is wrong with this?

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


The extra "S" you added to WSCal?

Rick


All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com