--____QVNHWPNZZYRFJGJPVEVF____
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64
Content-Disposition: inline; modification-date="Wed, 11 Mar 2008 08:26:31
-0500"

SSBoYXZlIGEgd29ya3NoZWV0IGluIHdoaWNoIEkgZW50ZXIgZGF0YSB1bmRlciA4IHRpdGxlZCBj
b2x1bW5zLiBBZnRlciBlbnRlcmluZyBpbmZvIG9uIHRoZSA4dGggYW5kIGZpbmFsIGNvbHVtbiwg
SSB3b3VsZCBsaWtlIGZvciBleGNlbCB0byBzb3J0IGJ5IGNvbHVtbiAxLCB3aGljaCBpcyB0aGUg
ZGF0ZSwgYW5kIGFsc28gbG9jayB0aGUgcm93LCBzYXkgcm93IDI0LCBwcmV2ZW50aW5nIG1pc3Rh
a2VzIG9uIHByZXZpb3VzbHkgZW50ZXJlZCB0cmFuc2FjdGlvbnMuIElmIGFueW9uZSBrbm93cyBo
b3cgdG8gaGVscCwgSSB3b3VsZCBkZWZpbml0ZWx5IGFwcHJlY2lhdGUgaXQuDQoNCkRhdmlk
--____QVNHWPNZZYRFJGJPVEVF____
Content-Type: multipart/related; boundary="____UTWYPPFWWFEFDBBPDCPN____"


--____UTWYPPFWWFEFDBBPDCPN____
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
Content-Disposition: inline; modification-date="Wed, 11 Mar 2008 08:26:31
-0500"

PEhUTUw+PEhFQUQ+DQo8TUVUQSBodHRwLWVxdWl2PUNvbnRlbnQtVHlwZSBjb250ZW50PSJ0ZXh0
L2h0bWw7IGNoYXJzZXQ9dXRmLTgiPg0KPE1FVEEgY29udGVudD0iTVNIVE1MIDYuMDAuMjkwMC4z
MjY4IiBuYW1lPUdFTkVSQVRPUj48L0hFQUQ+DQo8Qk9EWSBzdHlsZT0iTUFSR0lOOiA0cHggNHB4
IDFweDsgRk9OVDogMTBwdCBUYWhvbWEiPg0KPERJVj5JIGhhdmUgYSB3b3Jrc2hlZXQgaW4gd2hp
Y2ggSSBlbnRlciBkYXRhIHVuZGVyIDggdGl0bGVkIGNvbHVtbnMuIEFmdGVyIGVudGVyaW5nIGlu
Zm8gb24gdGhlIDh0aCBhbmQgZmluYWwgY29sdW1uLCBJIHdvdWxkIGxpa2UgZm9yIGV4Y2VsIHRv
IHNvcnQgYnkgY29sdW1uIDEsIHdoaWNoIGlzIHRoZSBkYXRlLCBhbmQgYWxzbyBsb2NrIHRoZSBy
b3csIHNheSByb3cgMjQsIHByZXZlbnRpbmcgbWlzdGFrZXMgb24gcHJldmlvdXNseSBlbnRlcmVk
IHRyYW5zYWN0aW9ucy4gSWYgYW55b25lIGtub3dzIGhvdyB0byBoZWxwLCBJIHdvdWxkIGRlZmlu
aXRlbHkgYXBwcmVjaWF0ZSBpdC48L0RJVj4NCjxESVY+Jm5ic3A7PC9ESVY+DQo8RElWPkRhdmlk
PC9ESVY+PC9CT0RZPjwvSFRNTD4=
--____UTWYPPFWWFEFDBBPDCPN____--

--____QVNHWPNZZYRFJGJPVEVF____--

Re: Auto sorting? Auto lock? by Otto

Otto
Wed Mar 12 06:29:42 CDT 2008

David
You will need a sheet event macro. The macro below will work with the
8th column being Column H, headers in row 1, and data starting in row 2.
You will need to unlock all the cells in the 8 columns for as many rows as
you think you might have data in the future. If you have data in only the 8
columns in the sheet, it would be simpler to unlock all the cells in the
sheet.
If you have some data already in those 8 columns that you want to "lock",
simply select all those cells and lock them. Be aware that
locking/unlocking a cell does nothing, by itself, to protect that cell. The
sheet must be protected as well. With the sheet protected, access to change
the contents of a cell will be denied ONLY if that cell is locked.
You need to protect the sheet.
Once you have done all the above, install the macro below.
The macro below will do the following:
The macro will fire with a change to the contents of any cell in the sheet.
If the changed cell (the "Target" cell) is not in Column H, the macro will
do nothing.
If the target cell is in Column H, the macro will:
Lock the cells in that row in all 8 columns.
Sort all the data in those 8 columns by Column A.
Done.
Note that this macro must be placed in the sheet module of that one specific
sheet. To access that module, right-click on the sheet tab, and select View
Code. Paste this macro into the displayed module. "X" out of the module to
return to your sheet. Post back if you need more. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("H:H")) Is Nothing And _
Target.Row > 1 Then
Dim RngToSort As Range
ActiveSheet.Unprotect
Range(Cells(Target.Row, 1), Cells(Target.Row, 8)).Locked = True
Set RngToSort = Range("A1", Range("A" &
Rows.Count).End(xlUp).Offset(, 7))
Application.EnableEvents = False
RngToSort.Sort Key1:=Range("A2"), Order1:=xlAscending,
Header:=xlYes, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom
Application.EnableEvents = True
ActiveSheet.Protect
End If
End Sub
"David Stricklen" <dstricklen@kumc.edu> wrote in message
news:47D68887.8C8A.004C.0@kumc.edu...
I have a worksheet in which I enter data under 8 titled columns. After
entering info on the 8th and final column, I would like for excel to sort by
column 1, which is the date, and also lock the row, say row 24, preventing
mistakes on previously entered transactions. If anyone knows how to help, I
would definitely appreciate it.

David