Sub Ex()
Dim A As Variant, i As Integer, x As Integer
x = InputBox("檔案數量")
For i = 1 To x
Range("A" & i).Select
'************************
'If I = 1 Then
'Range("A1").Select
'Else
'Range("A2").Select
'End If
'*****************************
Next
End Sub '作者: GBKEE 時間: 2013-5-13 06:18
Option Explicit
Sub 文字檔案()
Dim txt_name, i, x, oldname
Dim y As Variant
oldname = ThisWorkbook.Name
Range("A1").Select
x = InputBox("檔案數量")
For i = 1 To x
txt_name = i & ".txt" '<--改成 txt_name =y( i) & ".txt"