两个FOR:- strString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- strStart = "C3"
- strEnd = "F10"
-
- IntCStart = InStr(strString, Left(strStart, 1))
- IntCEnd = InStr(strString, Left(strEnd, 1))
-
- IntLStart = Mid(strStart, 2)
- IntLEnd = Mid(strEnd, 2)
-
- WorkPath = Left(Wscript.ScriptFullName, InStrRev(Wscript.ScriptFullName, "\")-1)
-
- Set objExcel = CreateObject("Excel.Application")
- objExcel.Visible = True
- objExcel.Workbooks.Add
-
- For i = IntCStart To IntCEnd
- For j = IntLStart To IntLEnd
- objExcel.Cells(j, i).Value = j & " " & i
- Next
- Next
-
- objExcel.ActiveWorkbook.SaveAs(WorkPath & "\a.xls")
- objExcel.Quit
复制代码
[ 本帖最后由 Undead 于 2010-1-7 12:51 编辑 ] |