Dim FIND_VALUE As String
Dim j As Double
FIND_VALUE = "RDD1250 Due SO not Billed"
For j = 1 To Worksheets.Count
If Worksheets(j).Range("C7").Value = FIND_VALUE Then
Worksheets(j).Activate
Range("B13", Cells(Range("B13").Row, Columns.Count).End(xlToLeft).End(xlDown)).Select
Selection.Copy
此代码提供类型错误不匹配...当我尝试运行此代码时,它给出了正确的结果但是当我尝试为其他工作表运行时给出类型错误不匹配..可以帮助这个以及部分错误搜索..我也试过“*”,但没有得到结果。
答案 0 :(得分:0)
虽然我看不到你粘贴数据的位置,但这应该有用......所以我会处理那些给出的信息很少。
Sub test1()
Dim ws As Worksheet
Dim FIND_VALUE As String
FIND_VALUE = "RDD1250 Due SO not Billed"
For Each ws In ActiveWorkbook.Worksheets
If Range("C7").Value = FIND_VALUE Then
Range("B13", Cells(Range("B13").Row, Columns.Count).End(xlToLeft).End(xlDown)).Copy
End If
Next
End Sub
提示:尽量避免使用.Select
和.Activate
Please see here for more helpful tips regarding .Select
and .Activate