Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
split 1.5/2.1 into 1.5 and 2.1
I have a cell with numbers in the following format 1.5/2.1. Is there a way
of picking the numbers out of that so I can populate two cells with 1.5 and 2.1? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
split 1.5/2.1 into 1.5 and 2.1
'VBA
strData = "1.5/2.1" Range("B1") = Split(strData,"/")(0) Range("C1") = Split(strData,"/")(1) 'Worksheetfunction =LEFT(A1,Find("/",A1)-1) =MID(A1,Find("/",A1)+1,len(A1)) If this post helps click Yes --------------- Jacob Skaria "Okieviking" wrote: I have a cell with numbers in the following format 1.5/2.1. Is there a way of picking the numbers out of that so I can populate two cells with 1.5 and 2.1? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
split 1.5/2.1 into 1.5 and 2.1
'VBA
strData = "1.5/2.1" Range("B1") = Split(strData,"/")(0) Range("C1") = Split(strData,"/")(1) Or, since we are going across columns, more simply... strData = "1.5/2.1" Range("B1:C1") = Split(strData, "/") Note to the OP... Jacob (and I) used a String variable (strData) to hold your values, but this value can come directly from a cell as well... just replace strData with Range("A1") assuming your cell is A1, of course. -- Rick (MVP - Excel) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Split | Excel Discussion (Misc queries) | |||
Split up | New Users to Excel | |||
How do I remove split a split window? | New Users to Excel | |||
split in vba | Excel Programming | |||
Split box | New Users to Excel |