View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Macro not running correctly

I can't figure out what you are trying to do. If desired, send your workbook
to my address below along with a your excel version and a detailed
explanation with before/after examples.

Why are you copying row 4 to rows 4:100. This cleans it up a bit
Sub UPDATE()
ActiveSheet.Unprotect
Range("A4:FU4").Copy Range("A4:FU100")
Range("A4:A100").Sort Key1:=Range("A4"), Order1:=xlDescending, _
Header:=xlGuess, MatchCase:=False, Orientation:=xlTopToBottom
End Sub



--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bernie" wrote in message
...
I'm very new at this so I hope I explain this so it can be understood.

I have two worksheets, one worksheet contains columns of data (containing
dates), each column represents a task that each individual needs to
complete.
The second worksheet is like the shortage tracker of who hasn't completed
what tasks. The task row in each worksheet is identical. In the shortage
tracker we used the formula,
=IF(UST!BH12,0,UST!$B12), this puts the name(s) of the person(s) that
didn't
complete the training for that task. The tasks columns go from BH to FU.
We
use an old macro that worked on another workbook but for some reason it
won't
work right on this worksheet. What it is suppose to do is take the names
of
the people who didn't complete the training and "push" the name to the top
of
the column so the people that need the training isn't spaced out all over
the
column.

Here is the first few lines of the macros from visual basic, it basically
repeats itself for each column:
Sub UPDATE()
ActiveSheet.Unprotect
Range("A4:FU4").Select
Selection.Copy
Range("A4:FU100").Select
ActiveSheet.Paste
Range("A4:A100").Select
Application.CutCopyMode = False

Range("A4:A100").Select
Selection.Sort Key1:=Range("A4"), Order1:=xlDescending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

I'd greatly appreciate any assistance.