I
Ian Elliott
Thanks in advance.
I have a word document that I want to get a number out of
using automation from Excel (I am automating some number
calculations for my boss). I will make a macro that opens
the file, searches for the relevant text, uses the 'end'
key to get to the end of the line, and then "gets" the
dollar amount.
I planned the getting part by ctrl+<- to go back one word,
but it goes back by commas (or periods or dollar signs).
So a number $23,657,832.31 needs eight ctrl+<- to position
the cursor to the left of the dollar sign, when starting
from the right. I am not sure what the dollar amounts (how
many commas, or if periods will be there) will be in
future files, so I shouldn't hard code eight ctrl+<- in
the code. Is there a key that gets to the beginning of a
dollar amount (like ctrl-alt something or other?),
ignoring commas and periods and dollar signs?. Is there
some visual basic code that will do that (like
position.NextWord or whatever?) Or will I have to write
some code that goes back character by character until it
finds a dollar sign?
Any help appreciated.
Thanks again.
I have a word document that I want to get a number out of
using automation from Excel (I am automating some number
calculations for my boss). I will make a macro that opens
the file, searches for the relevant text, uses the 'end'
key to get to the end of the line, and then "gets" the
dollar amount.
I planned the getting part by ctrl+<- to go back one word,
but it goes back by commas (or periods or dollar signs).
So a number $23,657,832.31 needs eight ctrl+<- to position
the cursor to the left of the dollar sign, when starting
from the right. I am not sure what the dollar amounts (how
many commas, or if periods will be there) will be in
future files, so I shouldn't hard code eight ctrl+<- in
the code. Is there a key that gets to the beginning of a
dollar amount (like ctrl-alt something or other?),
ignoring commas and periods and dollar signs?. Is there
some visual basic code that will do that (like
position.NextWord or whatever?) Or will I have to write
some code that goes back character by character until it
finds a dollar sign?
Any help appreciated.
Thanks again.