再问个简单的问题
如何在excel中的一列从自然数1递增到n,然后从n递减到1Dim xlApp As New Excel.Application
Dim xlBook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
xlApp.Visible = False
Set xlBook = xlApp.Workbooks.Open(App.Path & "\three.XLS")
Set xlsheet = xlBook.Worksheets(1)
With xlsheet
For i = 8 To b Step 4 '-------------合并单元格
.Range(Cells(i, 1), Cells(i + 3, 1)).Merge
next i
a = 7 + 4 * n
b = 7 + 8 * n
For i = 8 To b Step 4
If i <= a Then
.Cells(i, 1) = i / 4 - 1
Else
.Cells(i, 1) = ???????????
End If
Next i
End With
xlBook.Close
xlApp.Quit
Set xlApp = Nothing