View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Left Function in code

Les,

Try something like the following:

Dim S As String
Dim N1 As String
Dim N2 As String
S = "1234567-00"
N1 = Left(S, 7)
N2 = Right(S, 2)
Range("A1").Value = "'" & N1
Range("B1").Value = "'" & N2


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Les Stout" wrote in message
...
Hello,

I have got a number that i need to split using code. Could

somebody
please help me out.

it is always in this format 1234567-00

and i need to split it by the first 7 "1234567" in one column

and then
the last two "00" in another column.
The minus "-" can be lost.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!