- 帖子
- 8
- 主題
- 2
- 精華
- 0
- 積分
- 10
- 點名
- 0
- 作業系統
- Win7
- 軟體版本
- office 2007
- 閱讀權限
- 10
- 性別
- 男
- 來自
- 汐止
- 註冊時間
- 2015-2-25
- 最後登錄
- 2015-3-12
|
Dear stillfish00大大
想請教一下,我用巨集錄了個form,只是簡單的上色及加上標語,拉格子大小等
希望能夠當excel每一個值帶入後(就是您寫的程式的第56列後面)加上這個巨集把excel畫面整理。
但是測試都出現1004。我沒有宣告任何東西,只是把那個巨集加上去。
後來再逐行除錯的時候,一到我加的第一行就卡住了。
再煩請您幫幫忙,感恩~
大概如下面這樣- sName = Left(vFile, Len(vFile) - 4)
- For i = 0 To oMatch.Count - 1
- With Workbooks.Add
- With .Sheets(1)
- .[B3].Value = "SN"
- .[C3].Value = sSN
- .[B4].Value = "Model"
- .[C4].Value = sModel
-
- .[B6].Value = arHeader(0)
- .[C6].Value = oMatch(i).submatches(0)
- .[B7].Value = arHeader(1)
- .[C7].Value = oMatch(i).submatches(1)
-
- .[B9].Value = arHeader(2)
- .[C9].Value = oMatch(i).submatches(2)
- .[C10].Value = oMatch(i).submatches(3)
- .[B11].Value = arHeader(3)
- .[C11].Value = oMatch(i).submatches(4)
- End With
-
- Range("B2").Select
- ActiveCell.FormulaR1C1 = "甲"
- Range("B3").Select
- ActiveCell.FormulaR1C1 = _
- "乙" & Chr(10) & "丙"
- Range("B2:H2").Select
- With Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlBottom
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
複製代碼 |
|