Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
from Chip Pearson's site (I think) I got the following code: Function ColumnLetter(R As Range) As String ColumnLetter = Left(R.Address(False, False), _ 1 - (R.Column 26) - (R.Column 702)) End Function I was dead impressed as it does the trick in getting the column letters out in Excel 2007 etc My question is that the value true must have a value of minus one whereas I thought it was nought as in Excel formulae. Can anyone give a simple explanation, please? Many thanks Tim |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi Tim,
ActiveCell : cln = Evaluate("SUBSTITUTE(SUBSTITUTE(ADDRESS(1,COLUMN() ),""$"",""""),""1"","""")") ActiveCell.Offset(,1) : cln = Evaluate("SUBSTITUTE(SUBSTITUTE(ADDRESS(1,COLUMN() +1),""$"",""""),""1"","""")") ActiveCell.Offset(,-1) : cln = Evaluate("SUBSTITUTE(SUBSTITUTE(ADDRESS(1,COLUMN()-1),""$"",""""),""1"","""")") -- isabelle |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi Isabelle
Not sure why you sent me these long formulae? bw Tim "isabelle" wrote in message ... hi Tim, ActiveCell : cln = Evaluate("SUBSTITUTE(SUBSTITUTE(ADDRESS(1,COLUMN() ),""$"",""""),""1"","""")") ActiveCell.Offset(,1) : cln = Evaluate("SUBSTITUTE(SUBSTITUTE(ADDRESS(1,COLUMN() +1),""$"",""""),""1"","""")") ActiveCell.Offset(,-1) : cln = Evaluate("SUBSTITUTE(SUBSTITUTE(ADDRESS(1,COLUMN()-1),""$"",""""),""1"","""")") -- isabelle |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First off, here is a simpler function to use...
Function ColumnLetter(R As Range) As String ColumnLetter = Split(R.Address, "$")(1) End Function As to your question... True in VBA is -1, False is 0 whereas in Excel worksheet functions, TRUE is +1 and FALSE is 0. Rick Rothstein (MVP - Excel) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rick Rothstein has brought this to us :
First off, here is a simpler function to use... Function ColumnLetter(R As Range) As String ColumnLetter = Split(R.Address, "$")(1) End Function As to your question... True in VBA is -1, False is 0 whereas in Excel worksheet functions, TRUE is +1 and FALSE is 0. Rick Rothstein (MVP - Excel) Note that Excel worksheet functions consider TRUE as any value 0. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Rick
Many thanks for neat alternative - very elegant, which is always good. Thanks too for answer to initial question. Best wishes Tim "Rick Rothstein" wrote in message ... First off, here is a simpler function to use... Function ColumnLetter(R As Range) As String ColumnLetter = Split(R.Address, "$")(1) End Function As to your question... True in VBA is -1, False is 0 whereas in Excel worksheet functions, TRUE is +1 and FALSE is 0. Rick Rothstein (MVP - Excel) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
if any of 3 conditions is true, then answer is true | Excel Worksheet Functions | |||
Search for 2 true arguments and return true or false | Excel Discussion (Misc queries) | |||
Function to return True/False if all are validated as True by ISNU | Excel Worksheet Functions | |||
How do I stop Excel from changing the word true to TRUE? | Excel Discussion (Misc queries) | |||
Reverse false and combine with true true value | Excel Worksheet Functions |