how to copy as I type and then lock?

  • Thread starter Thread starter beeblemonster
  • Start date Start date
B

beeblemonster

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!
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top