-
-
Function ConvertExcelNumToInt(colName As String) As Integer
-
Dim i As Integer
-
Dim rtn As Integer
-
If Len(colName) = 0 Then
- ConvertExcelNumToInt = 0
-
Exit Function
-
End If
- colName = UCase(colName)
- rtn = 0
-
For i = 1 To Len(colName)
- rtn = rtn * 26
- rtn = rtn + Asc(Mid(colName, i, 1)) - 64
-
Next
- ConvertExcelNumToInt = rtn
-
End Function
-
-
Function ConvertToLetter(iCol As Integer) As String
-
Dim iAlpha As Integer
-
Dim iRemainder As Integer
- iAlpha = Fix(iCol / 26)
- iRemainder = iCol - (iAlpha * 26)
-
If iAlpha > 0 Then
-
If iRemainder = 0 Then
- iAlpha = iAlpha - 1
- iRemainder = 26
-
End If
-
If (iAlpha > 0) Then
- ConvertToLetter = Chr(iAlpha + 64)
-
End If
-
End If
-
If iRemainder > 0 Then
- ConvertToLetter = ConvertToLetter & Chr(iRemainder + 64)
-
End If
-
End Function
-
-
-
Function GetAutoFilterResult(sh As Worksheet) As VBA.Collection
-
Dim rtn As New VBA.Collection
-
Dim curCell As Range
- countchange = WorksheetFunction.Subtotal(3, sh.AutoFilter.Range)
-
If (countchange = sh.AutoFilter.Range.Columns.Count) Then
-
Exit Function
-
End If
-
Set curCell = sh.Cells(sh.AutoFilter.Range.Row + 1, 1)
-
While Not IsEmpty(curCell)
-
-
If curCell.RowHeight > 0 Then
- rtn.Add (curCell.Row)
-
End If
-
Set curCell = curCell.Offset(1, 0)
- Wend
-
Set GetAutoFilterResult = rtn
-
End Function
- '记事..
-
Sub dictionarySample()
-
Dim dic
-
Dim d As New VBA.Collection
-
-
-
d.Add ("1")
-
- d.Remove (1)
-
-
Set dic = CreateObject("scripting.dictionary")
-
-
-
dic.Add "key", "Dictionary"
-
s = dic.Item("key")
-
-
-
-
-
-
-
-
-
-
-
End Sub
相关文章:
-
1970-01-01
-
2021-10-08
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2021-05-19
-
2022-12-23
-
2022-12-23
猜你喜欢
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2021-04-16
相关资源
-
下载
2023-03-17
-
下载
2023-01-11
-
下载
2021-06-06
-
下载
2023-02-19