当前位置:首页教育技巧excel技巧excel表格单元

excel表格怎么跳到下一个宏

2024-07-16 08:43:23


1.excel宏 for each怎么跳到下一条

If cell.Hyperlinks(1).Address = Null

……

Else

cell.Offset(0, 4) = cell.Hyperlinks(1).Address

End If

改为

If not cell.Hyperlinks(1).Address = Null then

cell.Offset(0, 4) = cell.Hyperlinks(1).Address

End If

2.EXCEL 宏命令 不让光标选中有数据的单元格,并自动跳到下一个空

Private Sub Worksheet_SelectionChange(ByVal Target As range)

rw = Target.Row

col = Target.Column

If Target.Value "" Then

For i = rw To 65536

If Len(Cells(i, col)) Cells(i, col).Select

Exit Sub

End If

Next

End If

End Sub

'=====================================

上面那个不能单选 但 可以多选

下面这个不能单选 且 不能多选

'=====================================

Private Sub Worksheet_SelectionChange(ByVal Target As range)

rw = Target.Cells(1, 1).Row

col = Target.Cells(1, 1).Column

Set f = Application.WorksheetFunction

If f.CountA(Target) > 0 Then

For i = rw To 65536

If Len(Cells(i, col))

Cells(i, col).Select

Exit Sub

End If

Next

End If

End Sub

相关信息


电脑版

【免责声明】本站信息来自网友投稿及网络整理,内容仅供参考,如果有错误请反馈给我们及时更正,对文中内容的真实性和完整性本站不提供任何保证,不承但任何责任。
版权所有:学窍知识网 Copyright © 2011-2024 www.at317.com All Rights Reserved .