Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

who to take a number string

I need the 348,15 and the 10:50, and the position of the number change. I try Val but it didn't work.
I'm also using vba.

Real Time 348.15 Up1.87 (0.54%) 10:50AM EDT

Thank you
0
sharkyboy
Asked:
sharkyboy
  • 4
  • 4
1 Solution
 
TommySzalapskiCommented:
Do you mean you are trying to extract the values from the string?
Or are you trying to print the values in a string formatted like that?
0
 
sharkyboyAuthor Commented:
I need to extract the values from the string
0
 
TommySzalapskiCommented:
Okay. Will the string always look exactly like that except different numbers or will it change? (i.e. Up change to Down, Real Time change to Delayed, etc).

What are all the possibilities for how the string will look? You could write a macro to parse the string and pull out all numbers, but if the format of the string is fairly standardized, then you could do it with functions or simpler code.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
sharkyboyAuthor Commented:
I can change for Delayed or after market but the adress of the cell never change
0
 
sharkyboyAuthor Commented:
it could*
0
 
TommySzalapskiCommented:
Do you want those extracted numbers in cells or in your code somewhere?

If you want it in cells, then it's best to do with functions but we would need to know every possible scenario for what could be in the text.

If you want them in code, just step through the string and find where each number starts then extract using Val or any other function.
0
 
Saqib Husain, SyedEngineerCommented:
This will give you a start on Non-VBA functions. And, as Tommy says, you need to give info on possible variations to accommodate them in the formulas.

Saqib
Extract-numbers.xls
0
 
sharkyboyAuthor Commented:
I need the val function but when i wrote it, it didn't work
0
 
TommySzalapskiCommented:
The val function only works when the string begins with the number. So you need to find those parts using either a for loop or knowledge of all the possibilities of what text can be there.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now