Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to copy as I type and then lock?
Hi!
I'm writing a very large excel file and I need certain columns to be copied into another tab as I type them, or press enter after each cell. It's the first two columns of the first tab and I need them to be copied tp the second tab and then locked in the second tab, but open to edit in the first tab. I tried using a macro but I really screwed it up. Please help!!! thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to copy as I type and then lock?
This is an example that you modify to suit your needs. There are two tabs s1
and s2. The users edits cols A & B in s1. After each change, the contents of s1 are copied to s2 and s2 cols A & B are then protected: Private Sub Worksheet_Change(ByVal Target As Range) s = "A:B" Set r = Range(s) Set t = Target Set s1 = Sheets("s1") Set s2 = Sheets("s2") If Intersect(t, r) Is Nothing Then Exit Sub s2.Unprotect s2.Range(s).Locked = False s1.Range(s).Copy s2.Range(s) s2.Range(s).Locked = True s2.Protect End Sub -- Gary''s Student - gsnu200796 "beeblemonster" wrote: Hi! I'm writing a very large excel file and I need certain columns to be copied into another tab as I type them, or press enter after each cell. It's the first two columns of the first tab and I need them to be copied tp the second tab and then locked in the second tab, but open to edit in the first tab. I tried using a macro but I really screwed it up. Please help!!! thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy cells but lock editing | Excel Discussion (Misc queries) | |||
lock of copy command | Excel Worksheet Functions | |||
Get External Data : ODBC Lock Type | Excel Discussion (Misc queries) | |||
How to lock text box so others can type in but not resize it? | Excel Discussion (Misc queries) | |||
copy-past and lock cel! | Excel Programming |