Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default splitting a string


just in addition to gary's student's code, it code also be done like this:

v = Range("A1").Value
Range("A2").Value = Split(v, "/")(0)
Range("A3").Value = Split(v, "/")(1)
--


Gary


"roc616" wrote in message
...
I'm new to VBA and running into problem on what is probably a very simple
task. Any help would be greatly appreciated.

I have information in a cell like this: 4.5/FNCL 5.

I need to copy the information before the / to another cell, and the
information after the / to a different cell.

This is what I have been doing:

dim coupon
dim collat

coupon = Mid(Sheets("temp").Cells(row, 5).Value, 1, Find("/",
Sheets("temp").Cells(row, 5).Value, 1) - 1)

collat = Mid(Sheets("temp").Cells(row, 5).Value, Find("/",
Sheets("temp").Cells(row, 5).Value, 1) + 1, Len(Sheets("temp").Cells(row,
5).Value))

the formula using mid and find works when i put in a cell in excel, but it's
not working in the VBA. when i click debug, it highlights the word "find"
saying it doesn't recognize the function. Does anyone know a different way
of doing it or what could be wrong?

Thank you.



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
String splitting for inconsistent strings Richard Excel Worksheet Functions 3 June 22nd 06 03:55 AM
Splitting a text string into string and number mcambrose Excel Discussion (Misc queries) 4 February 21st 06 03:47 PM
splitting string in 2 parts ashishprem[_4_] Excel Programming 2 February 14th 06 01:30 PM
Splitting a String AMK4[_42_] Excel Programming 8 February 14th 06 12:12 AM
Splitting Character String mcertini Excel Worksheet Functions 2 September 12th 05 09:41 AM


All times are GMT +1. The time now is 09:33 AM.

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

About Us

"It's about Microsoft Excel"