Este Código VBA:列出所有沒有 Excel 的選項,精確修改格式,在「MsgBox」中精確設定 1 列的選項,對所選行的數量進行量化,可能無法修改程式碼。
Sai 'MsgBox "Too much permutations!", vbInformation, "Kutools for Excel"' Que é somente digitalável e não por seleção
進入第 1 欄/林哈斯選擇。
例子
linhas selecionadas 12345678 permutar 5 das 8 Continando como esta no codigo。
科梅卡 12345
'終端 em 87654。
Sai 'MsgBox "Too much permutations!", vbInformation, "Kutools for Excel"' Que é somente digitalável e não por seleção
進入第 1 欄/林哈斯選擇。
例子
linhas selecionadas 12345678 permutar 5 das 8 Continando como esta no codigo。
科梅卡 12345
'終端 em 87654。
'Sub
GetString()
'Updateby Extendoffice
Dim
xStr
As
String
Dim
FRow
As
Long
Dim
xScreen
As
Boolean
xScreen = Application.ScreenUpdating
Application.ScreenUpdating =
False
xStr = Application.InputBox(
"Enter text to permute:"
,
"Kutools for Excel"
, , , , , , 2)
If
Len(xStr) < 2
Then
Exit
Sub
If
Len(xStr) >= 8
Then
MsgBox
"Too many permutations!"
, vbInformation,
"Kutools for Excel"
Exit
Sub
Else
ActiveSheet.Columns(1).Clear
FRow = 1
Call
GetPermutation(
""
, xStr, FRow)
End
If
Application.ScreenUpdating = xScreen
End
Sub
Sub
GetPermutation(Str1
As
String
, Str2
As
String
,
ByRef
xRow
As
Long
)
Dim
i
As
Integer
, xLen
As
Integer
xLen = Len(Str2)
If
xLen < 2
Then
Range(
"A"
& xRow) = Str1 & Str2
xRow = xRow + 1
Else
For
i = 1
To
xLen
Call
GetPermutation(Str1 + Mid(Str2, i, 1), Left(Str2, i - 1) + Right(Str2, xLen - i), xRow)
Next
End
If
'End
Sub