|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub Micro3_Search_note()
Sheets("Search").Select
Range("N:N").ClearContents
ActiveSheet.AutoFilterMode = False
Sheets("Search").Select
Range("N1").Select
Dim jn As Integer, T As Integer, H As Integer
For jn = 5 To Sheets("Search").[g65530].End(3).Row ' it is right
For T = 2 To Sheets("Receving problem report").[d65530].End(3).Row
H = T + 1
If Sheets("Search").Cells(jn, 7).Value = Sheets("Receving problem report").Cells(H, 4).Value Then
Sheets("Search").Cells(jn, 7).Offset(0, 7).Value = "NOTE: receiving problem"
Sheets("Search").Cells(jn, 7).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 16751103
.TintAndShade = 0
.PatternTintAndShade = 0
End With
'Sheets("Search").Cells(jn, 7).AddComment.Text "Xxxxxxxxxxxxxxxxxxx" '添加这句就报错1004,大家可以将前面的单引号去掉来调试。
Sheets("Search").Cells(3, 1).Select
End If
Next
Next
End Sub
----------------------
谢谢之前的有心人,我更新了一下测试用的表格。
Question 20130319.rar
(34.78 KB, 下载次数: 8)
---------------------
更新: 添加了 重置 按钮,如果测试失败,直接点重置,表格内容又回到测试前,方便大家继续测试。
---------------------
就是很不解,为啥子报错呢。该怎么怎么做?
|
|