simpman 发表于 2014-12-17 11:55
太精彩了,佩服,再来玩跳转好吗?在分表写了跳转的函数效果如表1 F2,F6,能不能实现在汇总表白色区域用 ... - Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) ''代码放在【汇总】表代码区
- Dim r&, k&, c&, m&, sh$, js$
- r = Cells(Rows.Count, 1).End(3).Row
- If Intersect(Target, Union(Range("f3:l" & r), Range("n3:t" & r))) Is Nothing Then Exit Sub
- If Target = "" Then Exit Sub
- k = Target.Row: c = Target.Column: sh = Cells(k, 1): js = Cells(2, c)
- s = IIf(c < 13, "A类" & js, "B类" & js): l = IIf(c < 13, 6, 10)
- With Sheets(sh)
- .Select: .Cells(.Columns(l).Find(s, , , 1).Row, l).Resize(1, 4).Select
- End With
- End Sub
复制代码 |