![]() |
Re: Excel-Sheet mit Delphi verändern
Hallo,
Hab mal eine schöne Function im Netz gefunden, die das Problem behandelt:
Delphi-Quellcode:
// Hilfsfunktion
(*Wandelt Buchstaben-Zahlenkombination in eine ZellenReferenz für Excel um*) function RefToCell(RowID, ColID : Integer): string; var ACount, APos : Integer; begin ACount := ColID div 26; APos := ColID mod 26; if APos = 0 then begin ACount := ACount-1; APos := 26; end; if ACount = 0 then begin Result := Chr(Ord('A') + ColID -1) + IntToStr(RowID); end; if ACount = 1 then begin Result := 'A' + Chr(Ord('A') + APos -1) + IntToStr(RowID); end; if ACount > 1 then begin Result := Chr(Ord('A') + ACount -1) + Chr(Ord('A') + APos - 1) + IntToStr(RowID); end; end; Gruß Hermann |
Re: Excel-Sheet mit Delphi verändern
danke genau das wollte ich wissen :-D
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:51 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz