Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
lock command button | Excel Worksheet Functions | |||
Using command buttons to enter data | Excel Discussion (Misc queries) | |||
Lock the cell once enter the data | Excel Worksheet Functions | |||
Lock the cell once enter the data | Excel Worksheet Functions | |||
How can I lock worksheets while macros can still enter into them? | Excel Discussion (Misc queries) |