ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA for Skipping Cells (https://www.excelbanter.com/excel-programming/406459-vba-skipping-cells.html)

MarthaSue

VBA for Skipping Cells
 
Can someone tell me the code for skipping all locked cells; using the tab key
to skip to unlocked cells . . . thanks for your time . . .

MarthaSue

TAB BUTTON - VBA TO SKIP CELLS
 
Could i not set this up with this formula but use the "Tab" Key instead of
Cntrl-E

"Gary''s Student" wrote:

If you assign a shortcut key like CNTRL-e to:

Sub nonlocked()
'
' gsnuxx
'
startit = False
For Each r In ActiveSheet.UsedRange
If startit Then
If r.Locked Then
Else
r.Select
Exit Sub
End If
End If
If Intersect(r, ActiveCell) Is Nothing Then
Else
startit = True
End If
Next
End Sub

You can "tab" over locked cells by touching CNTRL-e rather than the TAB key.
--
Gary''s Student - gsnu200770


"MarthaSue" wrote:

Can someone tell me the code for skipping all locked cells; using the tab key
to skip to unlocked cells . . . thanks for your time . . .



All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com