- ·上一篇:怎么把几行excel表格放到一行
- ·下一篇:excel表格怎么更改源的设置
excel表格怎么跳到下一个宏
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