- 帖子
- 764
- 主題
- 254
- 精華
- 0
- 積分
- 1031
- 點名
- 0
- 作業系統
- windows 11
- 軟體版本
- OFFICE2021
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2011-5-30
- 最後登錄
- 2025-4-6
|
6#
發表於 2015-4-19 08:27
| 只看該作者
本帖最後由 t8899 於 2015-4-19 08:44 編輯
目前我權限不足,不能下載東西,只能看貼圖,所以你需要把程式碼及待變更格式資料頁面貼出來
tyrone123456 發表於 2015-4-19 07:52 
同樣的程式碼我把它放在其他的活頁簿是正常的
但在這個活頁簿就是不行很詭異???
你有信箱嗎?我寄給您??
Sub abc()
Application.ScreenUpdating = False
' Application.EnableEvents = False
' -----------------------------------------------
With Workbooks("book2.xls").Sheets("Sheet3")
Dim ou, ddd, eee
For ou = 2 To 61
If .Cells(ou, "c") > 2.8 Then
ddd = ddd & "3" & .Cells(ou, "b") & ","
ElseIf .Cells(ou, "c") > 1.8 Then
ddd = ddd & "2" & .Cells(ou, "b") & ","
ElseIf .Cells(ou, "c") > 0.8 Then
ddd = ddd & .Cells(ou, "b") & ","
End If
Next
.Range("e65536").End(xlUp).Offset(1) = ddd
.Range("e65536").End(xlUp).Offset(0).Characters(1, 3).Font.ColorIndex = 3
End With
Workbooks("32.xls").Sheets("Sheet1").Range("a65536").End(xlUp).Offset(1) = ddd
' 加入上面這行測試,沒設定顏色,但字體確是紅色???
End Sub
|
|