Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Liz Liz is offline
external usenet poster
 
Posts: 133
Default Character symbol meaning

Hi -
Can someone tell me what the "^" symbol in the below variables is? Is this a
symbol for space or end of line?

lastw = .Substitute(str2, " ", "^", Len(str2) - Len(.Substitute(str2, " ",
"")))
lasti = .Find("^", lastw) + 1

Thanks,
Liz
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Character symbol meaning

In formulas, it represents to the operator to raise a value to a power:

=7^3
same as
=7*7*7
same as
343
--
Gary''s Student - gsnu200852


"Liz" wrote:

Hi -
Can someone tell me what the "^" symbol in the below variables is? Is this a
symbol for space or end of line?

lastw = .Substitute(str2, " ", "^", Len(str2) - Len(.Substitute(str2, " ",
"")))
lasti = .Find("^", lastw) + 1

Thanks,
Liz

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Character symbol meaning

In your case it is a text character....

In Ms Excel the 'Caret' operator is raise to the power of ....

=3^2

is 3 raised to the power of 2 which is 9


If this post helps click Yes
---------------
Jacob Skaria


"Liz" wrote:

Hi -
Can someone tell me what the "^" symbol in the below variables is? Is this a
symbol for space or end of line?

lastw = .Substitute(str2, " ", "^", Len(str2) - Len(.Substitute(str2, " ",
"")))
lasti = .Find("^", lastw) + 1

Thanks,
Liz

  #4   Report Post  
Posted to microsoft.public.excel.programming
Liz Liz is offline
external usenet poster
 
Posts: 133
Default Character symbol meaning

Thank you Gary. Can it mean something different for a string? I have a
string in this cell and not sure what these variables are doing....I know
they are supposed to find the last word in the cell and extract it.

Thanks,
Liz

"Gary''s Student" wrote:

In formulas, it represents to the operator to raise a value to a power:

=7^3
same as
=7*7*7
same as
343
--
Gary''s Student - gsnu200852


"Liz" wrote:

Hi -
Can someone tell me what the "^" symbol in the below variables is? Is this a
symbol for space or end of line?

lastw = .Substitute(str2, " ", "^", Len(str2) - Len(.Substitute(str2, " ",
"")))
lasti = .Find("^", lastw) + 1

Thanks,
Liz

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Character symbol meaning

The code is attempting to locate the location within the text assigned to
the variable 'str2'. This section (in the assignment to 'lastw')...

Len(str2) - Len(.Substitute(str2, " ", ""))

counts the number of spaces in the original text (it does this by finding
the difference between the length of the original text and the text with all
its spaces removed. Then the code uses this number (of spaces) in the
worksheet's Substitute function to replace the last space with a "^" symbol.
This code then assigns the original text with the last space changed to a
"^" symbol to the 'lastw' variable. The next line then locates the "^"
symbol (using the worksheet's Find function) and returns that position
number to the 'lasti' variable.

Okay, that is what the code is doing... the "^" symbol has no special
meaning... any character that would be found in the original text would work
as well. Just so you know, the code you posted is not an efficient way to
locate the last space in a text string. Here is how I would do it with a
single line of code...

lasti = InStrRev(str2, " ") + 1

--
Rick (MVP - Excel)


"Liz" wrote in message
...
Hi -
Can someone tell me what the "^" symbol in the below variables is? Is this
a
symbol for space or end of line?

lastw = .Substitute(str2, " ", "^", Len(str2) - Len(.Substitute(str2, " ",
"")))
lasti = .Find("^", lastw) + 1

Thanks,
Liz




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Character symbol meaning

hi
without seeing the rest of your code, i'm guessing but..... it appears that
its a marker of some sort because after the substituting in the frist line,
the second line tries to find the marker and then adds 1 to what ever the
find returns.

like i said...wild guessing here.

Regards
FSt1

"Liz" wrote:

Thank you Gary. Can it mean something different for a string? I have a
string in this cell and not sure what these variables are doing....I know
they are supposed to find the last word in the cell and extract it.

Thanks,
Liz

"Gary''s Student" wrote:

In formulas, it represents to the operator to raise a value to a power:

=7^3
same as
=7*7*7
same as
343
--
Gary''s Student - gsnu200852


"Liz" wrote:

Hi -
Can someone tell me what the "^" symbol in the below variables is? Is this a
symbol for space or end of line?

lastw = .Substitute(str2, " ", "^", Len(str2) - Len(.Substitute(str2, " ",
"")))
lasti = .Find("^", lastw) + 1

Thanks,
Liz

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Character symbol meaning

Okay, that is what the code is doing... the "^" symbol has no special
meaning... any character that would be found in the original text would
work as well.


I left out the word "not" in the above description; it should have read...

"Okay, that is what the code is doing... the "^" symbol has no special
meaning... any character that would ***NOT*** be found in the
original text would work as well."

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
The code is attempting to locate the location within the text assigned to
the variable 'str2'. This section (in the assignment to 'lastw')...

Len(str2) - Len(.Substitute(str2, " ", ""))

counts the number of spaces in the original text (it does this by finding
the difference between the length of the original text and the text with
all its spaces removed. Then the code uses this number (of spaces) in the
worksheet's Substitute function to replace the last space with a "^"
symbol. This code then assigns the original text with the last space
changed to a "^" symbol to the 'lastw' variable. The next line then
locates the "^" symbol (using the worksheet's Find function) and returns
that position number to the 'lasti' variable.

Okay, that is what the code is doing... the "^" symbol has no special
meaning... any character that would be found in the original text would
work as well. Just so you know, the code you posted is not an efficient
way to locate the last space in a text string. Here is how I would do it
with a single line of code...

lasti = InStrRev(str2, " ") + 1

--
Rick (MVP - Excel)


"Liz" wrote in message
...
Hi -
Can someone tell me what the "^" symbol in the below variables is? Is
this a
symbol for space or end of line?

lastw = .Substitute(str2, " ", "^", Len(str2) - Len(.Substitute(str2, "
",
"")))
lasti = .Find("^", lastw) + 1

Thanks,
Liz



  #8   Report Post  
Posted to microsoft.public.excel.programming
Liz Liz is offline
external usenet poster
 
Posts: 133
Default Character symbol meaning

Thank you all!
Rick, I really appreciate your explanation and assistance in an alternative.

"Rick Rothstein" wrote:

The code is attempting to locate the location within the text assigned to
the variable 'str2'. This section (in the assignment to 'lastw')...

Len(str2) - Len(.Substitute(str2, " ", ""))

counts the number of spaces in the original text (it does this by finding
the difference between the length of the original text and the text with all
its spaces removed. Then the code uses this number (of spaces) in the
worksheet's Substitute function to replace the last space with a "^" symbol.
This code then assigns the original text with the last space changed to a
"^" symbol to the 'lastw' variable. The next line then locates the "^"
symbol (using the worksheet's Find function) and returns that position
number to the 'lasti' variable.

Okay, that is what the code is doing... the "^" symbol has no special
meaning... any character that would be found in the original text would work
as well. Just so you know, the code you posted is not an efficient way to
locate the last space in a text string. Here is how I would do it with a
single line of code...

lasti = InStrRev(str2, " ") + 1

--
Rick (MVP - Excel)


"Liz" wrote in message
...
Hi -
Can someone tell me what the "^" symbol in the below variables is? Is this
a
symbol for space or end of line?

lastw = .Substitute(str2, " ", "^", Len(str2) - Len(.Substitute(str2, " ",
"")))
lasti = .Find("^", lastw) + 1

Thanks,
Liz



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Character symbol meaning

it used to, in very early versions of Excel, to indicate alignment. Where a
single quote ' meant align left and a cap, ^, meant align centre.
In your code, the ^ replaces the spaces in the text. Maybe there's some
issue whereby spaces aren't legitimate.....for example where the text is
used to create a range name (mind you, ^ isn't legal either!)


"FSt1" wrote in message
...
hi
without seeing the rest of your code, i'm guessing but..... it appears
that
its a marker of some sort because after the substituting in the frist
line,
the second line tries to find the marker and then adds 1 to what ever the
find returns.

like i said...wild guessing here.

Regards
FSt1

"Liz" wrote:

Thank you Gary. Can it mean something different for a string? I have a
string in this cell and not sure what these variables are doing....I know
they are supposed to find the last word in the cell and extract it.

Thanks,
Liz

"Gary''s Student" wrote:

In formulas, it represents to the operator to raise a value to a power:

=7^3
same as
=7*7*7
same as
343
--
Gary''s Student - gsnu200852


"Liz" wrote:

Hi -
Can someone tell me what the "^" symbol in the below variables is? Is
this a
symbol for space or end of line?

lastw = .Substitute(str2, " ", "^", Len(str2) - Len(.Substitute(str2,
" ",
"")))
lasti = .Find("^", lastw) + 1

Thanks,
Liz


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
Symbol = Character Code 25BA Ken Excel Discussion (Misc queries) 1 May 24th 10 11:16 PM
meaning of heart symbol on ALT+Pagedown Ron B Excel Discussion (Misc queries) 2 February 15th 09 07:56 PM
In Excel, what is the meaning of " ^ " symbol in a formula? Anthony Excel Discussion (Misc queries) 2 October 6th 06 01:09 AM
List of Symbol and Character Number Polina Excel Discussion (Misc queries) 4 May 6th 05 12:17 AM
How do I create a new symbol to enter as a character? Coryne17 Excel Worksheet Functions 4 April 20th 05 05:48 PM


All times are GMT +1. The time now is 02:46 PM.

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"