|
楼主 |
发表于 2011-8-16 13:38
|
显示全部楼层
你看一下给我的附件,打开会出错
,这样打开这个表关闭文件,再打开的时候
返回不到主页,还有我这个表里有一个宏,我这样放进去不会用
Private Sub Worksheet_Change(ByVal Target As Range)
'On Error GoTo xxx
t = Target.Address
If t <> "$B$1" And t <> "$B$2" Then Exit Sub
Application.EnableEvents = False
Application.ScreenUpdating = False
Range("a4:k65536").Clear
For Each s In ActiveSheet.Shapes
s.Delete
Next
x = 4
With Sheets("材料明细表")
c = "*" & Range("b1") & "*"
n = "*" & Range("b2") & "*"
For r = 3 To .Range("A65536").End(xlUp).Row
If .Cells(r, 1) Like c And .Cells(r, 2) Like n Then
.Cells(r, 1).Resize(1, 10).Copy Cells(x, 1)
x = x + 1
End If
Next
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
xxx:
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$3" Then
Sheets("材料查询表").Visible = -1
Sheets("材料查询表").Select
End If
End Sub
|
|