Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Symbol = Character Code 25BA | Excel Discussion (Misc queries) | |||
meaning of heart symbol on ALT+Pagedown | Excel Discussion (Misc queries) | |||
In Excel, what is the meaning of " ^ " symbol in a formula? | Excel Discussion (Misc queries) | |||
List of Symbol and Character Number | Excel Discussion (Misc queries) | |||
How do I create a new symbol to enter as a character? | Excel Worksheet Functions |