Lock Cell After Enter Command

D

DOUG

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
 
J

JLatham

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

DOUG

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

DOUG

JLatham said:
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 said:
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
 
J

JLatham

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 said:
JLatham: Does it matter where I paste the routine on the VBA page?

DOUG

JLatham said:
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 said:
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
 
D

DOUG

JLatham: Thank you!

DOUG

JLatham said:
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 said:
JLatham: Does it matter where I paste the routine on the VBA page?

DOUG

JLatham said:
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.

:

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
 
J

JLatham

You're certainly welcome, glad I could help.

DOUG said:
JLatham: Thank you!

DOUG

JLatham said:
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 said:
JLatham: Does it matter where I paste the routine on the VBA page?

DOUG

:

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.

:

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
 
Top