Forum Discussion
Keyboard Shortcut for first Non Zero cell
- Jun 18, 2021
Make sure that you display the Developer tab of the ribbon.
On this tab, click Macros.
Enter FindNonZero in the Macro Name box, and click Create.
Make the code look like this:
Sub FindNonZero() Dim i As Long For i = 1 To 10000 If ActiveCell.Offset(0, i).Value <> 0 Then ActiveCell.Offset(0, i).Select Exit For End If Next i End Sub
Witch back to Excel.
Click Macros again.
Select FindNonZero and click Options...
Click in the Shortcut key box.
You can either enter a character or Shift+character. As a result you will assign Ctrl+character or Ctrl+Shift+character as shortcut. Try to avoid built-in shortcuts such ax Ctrl+C and Ctrl+S.
Click OK.
Save the workbook as a macro-enabled workbook.
Make sure that you allow macros when you open it.
Make sure that you display the Developer tab of the ribbon.
On this tab, click Macros.
Enter FindNonZero in the Macro Name box, and click Create.
Make the code look like this:
Sub FindNonZero()
Dim i As Long
For i = 1 To 10000
If ActiveCell.Offset(0, i).Value <> 0 Then
ActiveCell.Offset(0, i).Select
Exit For
End If
Next i
End Sub
Witch back to Excel.
Click Macros again.
Select FindNonZero and click Options...
Click in the Shortcut key box.
You can either enter a character or Shift+character. As a result you will assign Ctrl+character or Ctrl+Shift+character as shortcut. Try to avoid built-in shortcuts such ax Ctrl+C and Ctrl+S.
Click OK.
Save the workbook as a macro-enabled workbook.
Make sure that you allow macros when you open it.
- HansVogelaarJun 19, 2021MVP
Don't hold your breath - Excel does not have a built-in shortcut for this.
- Tony2021Jun 19, 2021Iron Contributorvery well then. Ok. thank you Hans.