Auto Skip

  • Thread starter Thread starter SkippyPB
  • Start date Start date
S

SkippyPB

Is there a way to detect the column a cursor is in and make it skip to
the next column thus preventing entry in the original cursor position?

Also, is there a way to password protect only the macros/VBA code in a
workbook?

Thanks.
////
(o o)
-oOO--(_)--OOo-

"If tin whistles are made out of tin,
what do they make fog horns out of?"
-- George Carlin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Remove nospam to email me.

Steve
 
SkippyPB said:
Is there a way to detect the column a cursor is in and make it skip to
the next column thus preventing entry in the original cursor position?


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Target.Offset(0, 1).Select
End If

End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

Also, is there a way to password protect only the macros/VBA code in a
workbook?

Go to the VBIDE (Alt-F11), select the project, goto Tools>Project
Properties, and there is a protection tab to set a password. Not foolproof,
but the bset ther is in VBA.
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Target.Offset(0, 1).Select
End If

End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



Go to the VBIDE (Alt-F11), select the project, goto Tools>Project
Properties, and there is a protection tab to set a password. Not foolproof,
but the bset ther is in VBA.

Thanks for the feedback. I'll give it a try and post the results.

Regards,
////
(o o)
-oOO--(_)--OOo-

"If tin whistles are made out of tin,
what do they make fog horns out of?"
-- George Carlin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Remove nospam to email me.

Steve
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Target.Offset(0, 1).Select
End If

End Sub

Tried that with no success. Let me give a further explanation of my
needs. I have two worksheets (WK1, WK2). Whenever data is entered in
Column B of WK1 it is automatically (via some VBA code) copied to
Column A of WK2 same row number. The user needs to complete entries
on WK2 so I'd like the cursor to skip over column A so they don't
accidentally delete what was copied there.

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



Go to the VBIDE (Alt-F11), select the project, goto Tools>Project
Properties, and there is a protection tab to set a password. Not foolproof,
but the bset ther is in VBA.

That works just fine.

Thanks.
////
(o o)
-oOO--(_)--OOo-

"If tin whistles are made out of tin,
what do they make fog horns out of?"
-- George Carlin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Remove nospam to email me.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top