Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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
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
copy cells but lock editing Lise Excel Discussion (Misc queries) 5 April 15th 10 12:39 PM
lock of copy command MANISH Excel Worksheet Functions 2 April 7th 09 06:08 PM
Get External Data : ODBC Lock Type [email protected] Excel Discussion (Misc queries) 0 September 1st 08 01:05 PM
How to lock text box so others can type in but not resize it? SimonL Excel Discussion (Misc queries) 0 October 27th 06 09:41 AM
copy-past and lock cel! albatros Excel Programming 1 September 4th 06 06:13 PM


All times are GMT +1. The time now is 11:14 PM.

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

About Us

"It's about Microsoft Excel"