Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cells C3:AB3 summed
Message
From
18/05/2004 08:46:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00903569
Message ID:
00904879
Views:
10
>Hi Terry,
>
>My problem was that I was using the Y coordinate and X coordinate of CELLS to read the data into my spreadsheet since the data is not just simply the table structure.
>
>I really needed to work out what the reference of the cell was, eg. CELL(1,1)=A1
>
>the problem was that I sometimes have more than 26 columns, in the end I wrote a piece of code to convert a reference Y,X to a letter and number, and used this in the appropriate SUM command.
>
>Thanks for your help.
>
>RC

Robin,
Original post seems to be answered by Yuri.
Is this what you mean :
* Return A, AA, BC etc noation for nth column
FUNCTION _GetChar
LPARAMETERS tnColumn && Convert tnvalue to Excel alpha notation
IF tnColumn = 0
  RETURN ""
ENDIF
IF tnColumn <= 26
  RETURN chr(asc("A")-1+tnColumn)
ELSE
  RETURN _GetChar(int(iif(tnColumn % 26 = 0,tnColumn - 1, tnColumn) / 26)) + ;
    _GetChar((tnColumn-1)%26+1)
ENDIF
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform