Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Split Ashwini Excel Discussion (Misc queries) 1 September 15th 09 12:12 PM
Split up dk New Users to Excel 5 December 16th 08 09:05 PM
How do I remove split a split window? Norm New Users to Excel 3 July 19th 08 10:31 PM
split in vba scott[_12_] Excel Programming 4 March 10th 08 06:33 PM
Split box ED New Users to Excel 1 April 27th 06 09:43 PM


All times are GMT +1. The time now is 12:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"