PC Review


Reply
 
 
SkippyPB
Guest
Posts: n/a
 
      30th Jul 2007
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
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      30th Jul 2007

"SkippyPB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.


 
Reply With Quote
 
SkippyPB
Guest
Posts: n/a
 
      31st Jul 2007
On Mon, 30 Jul 2007 17:17:22 +0100, "Bob Phillips"
<(E-Mail Removed)> wrote:

>
>"SkippyPB" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> 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.
>


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
 
Reply With Quote
 
SkippyPB
Guest
Posts: n/a
 
      31st Jul 2007
On Mon, 30 Jul 2007 17:17:22 +0100, "Bob Phillips"
<(E-Mail Removed)> wrote:

>
>"SkippyPB" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> 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
>


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.
>
>
>> 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.
>


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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pick List + Alphabetical Skip To or Auto Complete Hark2k Microsoft Excel Worksheet Functions 2 30th Apr 2010 01:29 PM
using IF to skip Julie Microsoft Excel Worksheet Functions 4 14th Mar 2008 10:21 PM
?0?0 program not found-skip auto check message =?Utf-8?B?YmF0dWdhamFo?= Windows XP Basics 5 5th Nov 2007 12:57 PM
Why does auto numbering skip numbers? =?Utf-8?B?bmlsbGE=?= Microsoft Word Document Management 1 4th Apr 2006 05:29 PM
using auto fill, but need to skip every 13th number gotzoom Microsoft Excel Discussion 3 20th Jan 2006 02:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:22 PM.