ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] EXCEL ¼Æ¦rÂনÄæ¦ì

[µo°Ý] EXCEL ¼Æ¦rÂনÄæ¦ì

§Ú¦b·L³nªº­¶­±§ä¨ì¤@­Óµ{¦¡¬O¥i¥H±N¼Æ¦rÂà´«¦¨Äæ¦ì

¨Ò¦p¡G1=A¡B5=E¡B26=Z¡B52=AZ¡K¡K

¦ý³o­Óµ{¦¡¦³ÂI¤p°ÝÃD¡A¹³ 677 À³¸Ó¬° "ZA"¡A¦ý«oÅã¥Ü¬° "Y["

¥H¤Î¤T­Ó­^¤å¥H¤WªºÄæ·|Åã¥Ü¤£¥X¨Ó¡A¨Ò¦p AAA Äæ

½Ð°Ý¥H¤Uªºµ{¦¡§Ú¸Ó¦p¦ó§ï©O¡H

ÁÂÁ¡ã
  1. Function ConvertToLetter(iCol As Integer) As String
  2.    Dim iAlpha As Integer
  3.    Dim iRemainder As Integer
  4.    iAlpha = Int(iCol / 27)
  5.    iRemainder = iCol - (iAlpha * 26)
  6.    If iAlpha > 0 Then
  7.       ConvertToLetter = Chr(iAlpha + 64)
  8.    End If
  9.    If iRemainder > 0 Then
  10.       ConvertToLetter = ConvertToLetter & Chr(iRemainder + 64)
  11.    End If
  12. End Function
½Æ»s¥N½X

¦^´_ 1# Genie
  1. Function ConvertToLetter(iCol As Integer) As String
  2.     ConvertToLetter = Replace(Cells(1, iCol).Address(False, False), "1", "")
  3. End Function
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 2# stillfish00


µ{¦¡¨Ï¥Î°_¨Ó¨S¦³°ÝÃD

«D±`·PÁ¡I¡I¡I

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-3-20 08:19 ½s¿è

¦^´_ 3# Genie
³o¤]¥i¥H,¾A¥Î©Ò¦³Excelª©¥»
  1. Function ConvertToLetter(iCol As Double) As String
  2.     If iCol <= Rows.Count * Columns.Count Then
  3.         ConvertToLetter = Split(Cells(iCol).Address, "$")(1)
  4.     Else
  5.         ConvertToLetter = iCol & " ¶W¥X¤u§@ªí½d³ò"
  6.     End If
  7. End Function
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  Genie
stillfish00 µoªí©ó 2015-3-19 13:21


½Ð°Ý³o­Ó¬O§_¥Î©ó"VBAProject"¤º? §Úpaste¨ì"VBAProject"¤º, ¦ý¤£¯à¨S¦³¥X²{¹w©wªºresult....

TOP

¦^´_ 4# GBKEE


³o­Óµ{¦¡´ú¸Õ¹L¤]¨S¦³°ÝÃD

ÁÂÁ¡I

TOP

        ÀR«ä¦Û¦b : ºw¤ô¦¨ªe¡C²É¦Ì¦¨ÅÚ¡A¤Å»´¤vÆF¡A¤Å¥Hµ½¤p¦Ó¤£¬°¡C
ªð¦^¦Cªí ¤W¤@¥DÃD