Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So what is wrong with this?
.cmbxPhonePre.Value = Mid(WSSCal.Range("Phone_Number").Value, 4, 3) The extra "S" you added to WSCal? Rick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how Sum if left (3 digits) are the equal to a field? | Excel Discussion (Misc queries) | |||
If number in cell does not equal 6 digits, add zeros to the left | Excel Discussion (Misc queries) | |||
Digits after the comma in Userform | Excel Programming | |||
comobox | Excel Discussion (Misc queries) | |||
macro & comobox | Excel Programming |