Bei zahlen es ja einfach möglich das er so hochzählt:
Code: Alles auswählen
00001
00002
00003
00004
00005
00006
00007
.....
.....
.....
Code: Alles auswählen
AAAA
AAAB
AAAC
AAAD
AAAE
.....
.....
.....
THX!!!
Moderator: Moderatoren
Code: Alles auswählen
00001
00002
00003
00004
00005
00006
00007
.....
.....
.....
Code: Alles auswählen
AAAA
AAAB
AAAC
AAAD
AAAE
.....
.....
.....
Wenn es dafür nicht auch schon einen "Einstellknopf" gibt, ist das vom Grundprinzip her nicht möglich. Text wird von links nach rechts, (Ganz-)zahlen aber von rechts nach links aufgebaut und beim Sortieren auch so interpretiert.„das Board“ hat geschrieben:Nur wie mache ich das mit Buchstaben
Code: Alles auswählen
function f_next_letter(slastletters) as string
nlength = len(slastletters)
nindex = nlength - 1
dim nletter(nindex) as variant
for i = 0 to nindex
nletter(i) = Asc(mid(slastletters,i+1,1))
next i
bcount = false
for i = nindex to 0 step -1
if not bcount then
if nletter(i) <> 90 then
nletter(i) = nletter(i)+1
bcount = true
else
nletter(i) = 65
bcount = false
endif
endif
next i
f_next_letter = ""
for i = 0 to nindex
f_next_letter = f_next_letter & chr(nletter(i))
next i
End function
Code: Alles auswählen
UZYX
Code: Alles auswählen
=f_next_letter(A1)
Code: Alles auswählen
UZYY
Code: Alles auswählen
function next_letter(slastletters) as string
nindex = len(slastletters) - 1
dim nletter(nindex) as long
for i = 0 to nindex
nletter(i) = Asc(mid(slastletters,i+1,1))
next i
for i = nindex to 0 step -1
if nletter(i) <> 90 and nletter(i) <> 122 then
nletter(i) = nletter(i)+1
exit for
else
if nletter(i) = 90 then
nletter(i) = 65
else
nletter(i) = 97
endif
endif
next i
next_letter = ""
for i = 0 to nindex
next_letter = next_letter & chr(nletter(i))
next i
End function
Code: Alles auswählen
=ZEICHEN(CODE(TEIL(A1;1;1))+WENN(CODE(GROSS(TEIL(A1;2;1)))=90;1;0)-WENN(CODE(GROSS(TEIL(A1;1;1)))=90;26;0))&ZEICHEN(CODE(TEIL(A1;2;1))+WENN(CODE(GROSS(TEIL(A1;3;1)))=90;1;0)-WENN(CODE(GROSS(TEIL(A1;2;1)))=90;26;0))&ZEICHEN(CODE(TEIL(A1;3;1))+WENN(CODE(GROSS(TEIL(A1;4;1)))=90;1;0)-WENN(CODE(GROSS(TEIL(A1;3;1)))=90;26;0))&ZEICHEN(CODE(RECHTS(A1;1))+1-WENN(CODE(GROSS(RECHTS(A1;1)))=90;26;0))