Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 460
Default Lock Cell After Enter Command

Is there a way to lock a cell in a shared workbook after the user has made an
entry? I did view Gordon Dibben's response to Casey on 9/23/07. It was
similar to what I am trying to do, but I did not understand where to place
the code in VBA.

DOUG
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Lock Cell After Enter Command

If the routine that Gord provided started with
Sub Worksheet_...
or
Private Sub Worksheet_...

Then it goes into the worksheet area which is easily accessible: right
click on the worksheet's name tab and click the [View Code] option in the
list. Copy and paste the code into the module that appears.

"DOUG" wrote:

Is there a way to lock a cell in a shared workbook after the user has made an
entry? I did view Gordon Dibben's response to Casey on 9/23/07. It was
similar to what I am trying to do, but I did not understand where to place
the code in VBA.

DOUG

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 460
Default Lock Cell After Enter Command

JLatham: Does it matter where I paste the routine on the VBA page?

DOUG

"JLatham" wrote:

If the routine that Gord provided started with
Sub Worksheet_...
or
Private Sub Worksheet_...

Then it goes into the worksheet area which is easily accessible: right
click on the worksheet's name tab and click the [View Code] option in the
list. Copy and paste the code into the module that appears.

"DOUG" wrote:

Is there a way to lock a cell in a shared workbook after the user has made an
entry? I did view Gordon Dibben's response to Casey on 9/23/07. It was
similar to what I am trying to do, but I did not understand where to place
the code in VBA.

DOUG

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Lock Cell After Enter Command

No, not really - if the module that appears when you choose [View Code] from
the sheet's name tab (after right-clicking on it) already has code in it, you
can paste it near the top, or down at the end of existing code.

BUT #1: if there is an "Option Explicit" statement at the beginning of the
module, then paste it in below that statement, and

BUT #2: if there is already a Worksheet_xxx event with the same name you are
wanting to enter, you can't do it. There can only be one event handling
process for a given event [as Worksheet_Change(),
Worksheet_BeforeDoubleClick(), etc] in each worksheet code module. If the
event you need to work with is already "in use" then you have to figure a way
to merge the code you need into what is already there.

"DOUG" wrote:

JLatham: Does it matter where I paste the routine on the VBA page?

DOUG

"JLatham" wrote:

If the routine that Gord provided started with
Sub Worksheet_...
or
Private Sub Worksheet_...

Then it goes into the worksheet area which is easily accessible: right
click on the worksheet's name tab and click the [View Code] option in the
list. Copy and paste the code into the module that appears.

"DOUG" wrote:

Is there a way to lock a cell in a shared workbook after the user has made an
entry? I did view Gordon Dibben's response to Casey on 9/23/07. It was
similar to what I am trying to do, but I did not understand where to place
the code in VBA.

DOUG

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 460
Default Lock Cell After Enter Command

JLatham: Thank you!

DOUG

"JLatham" wrote:

No, not really - if the module that appears when you choose [View Code] from
the sheet's name tab (after right-clicking on it) already has code in it, you
can paste it near the top, or down at the end of existing code.

BUT #1: if there is an "Option Explicit" statement at the beginning of the
module, then paste it in below that statement, and

BUT #2: if there is already a Worksheet_xxx event with the same name you are
wanting to enter, you can't do it. There can only be one event handling
process for a given event [as Worksheet_Change(),
Worksheet_BeforeDoubleClick(), etc] in each worksheet code module. If the
event you need to work with is already "in use" then you have to figure a way
to merge the code you need into what is already there.

"DOUG" wrote:

JLatham: Does it matter where I paste the routine on the VBA page?

DOUG

"JLatham" wrote:

If the routine that Gord provided started with
Sub Worksheet_...
or
Private Sub Worksheet_...

Then it goes into the worksheet area which is easily accessible: right
click on the worksheet's name tab and click the [View Code] option in the
list. Copy and paste the code into the module that appears.

"DOUG" wrote:

Is there a way to lock a cell in a shared workbook after the user has made an
entry? I did view Gordon Dibben's response to Casey on 9/23/07. It was
similar to what I am trying to do, but I did not understand where to place
the code in VBA.

DOUG



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Lock Cell After Enter Command

You're certainly welcome, glad I could help.

"DOUG" wrote:

JLatham: Thank you!

DOUG

"JLatham" wrote:

No, not really - if the module that appears when you choose [View Code] from
the sheet's name tab (after right-clicking on it) already has code in it, you
can paste it near the top, or down at the end of existing code.

BUT #1: if there is an "Option Explicit" statement at the beginning of the
module, then paste it in below that statement, and

BUT #2: if there is already a Worksheet_xxx event with the same name you are
wanting to enter, you can't do it. There can only be one event handling
process for a given event [as Worksheet_Change(),
Worksheet_BeforeDoubleClick(), etc] in each worksheet code module. If the
event you need to work with is already "in use" then you have to figure a way
to merge the code you need into what is already there.

"DOUG" wrote:

JLatham: Does it matter where I paste the routine on the VBA page?

DOUG

"JLatham" wrote:

If the routine that Gord provided started with
Sub Worksheet_...
or
Private Sub Worksheet_...

Then it goes into the worksheet area which is easily accessible: right
click on the worksheet's name tab and click the [View Code] option in the
list. Copy and paste the code into the module that appears.

"DOUG" wrote:

Is there a way to lock a cell in a shared workbook after the user has made an
entry? I did view Gordon Dibben's response to Casey on 9/23/07. It was
similar to what I am trying to do, but I did not understand where to place
the code in VBA.

DOUG

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
lock command button jan Excel Worksheet Functions 0 June 17th 08 08:38 PM
Using command buttons to enter data Nick T Excel Discussion (Misc queries) 1 January 12th 07 02:20 PM
Lock the cell once enter the data Dinesh Excel Worksheet Functions 1 August 11th 06 06:10 PM
Lock the cell once enter the data Dinesh Excel Worksheet Functions 0 August 11th 06 03:11 AM
How can I lock worksheets while macros can still enter into them? enginguven Excel Discussion (Misc queries) 3 January 12th 06 12:56 AM


All times are GMT +1. The time now is 06:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"