LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Workbook_SheetChange won't run

My understanding of Workbook_SheetChange is that with ANY change ANYWHERE in
the workbook, the code runs, correct? I can't get it to work and don't know
why:

GOAL: Resort the "PatientNamesRooms" (just a list of about 60 names and
associated hospital room numbers) whenever a change is made on a different
tab within the workbook. Cells in "PatientNamesRooms" are index formulas
that get names based on room numbers from a main roster of names. We need to
quickly find the name alphabetically to determine what room they're in.

I've gotten the code to run (names to sort) using Worksheet SelectionChange.
But that doesn't meet my need. It needs to resort anytime someone updates a
name in the roster (like when a patient leaves or is admitted on the floor).

CODE THAT WON'T RUN:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Source As Range)
Range("PatientNamesRooms").Select Selection.Sort Key1:=Range("A1"),
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
DataOption1:=xlSortNormal

End Sub

Help?
 
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
Workbook_SheetChange masterphilch Excel Programming 5 January 19th 06 08:35 PM
Workbook_SheetChange not working RAP Excel Programming 7 August 27th 05 04:40 PM
Workbook_SheetChange Matt B[_3_] Excel Programming 3 April 25th 05 01:40 PM
workbook_sheetchange JulieD Excel Programming 1 June 14th 04 04:32 AM
Workbook_SheetChange will not fire Robert Willard Excel Programming 1 September 10th 03 07:52 PM


All times are GMT +1. The time now is 03:27 AM.

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"