Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Macro not running correctly

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.


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
Data don't enter correctly in Excel 2002 running under Vista Conrad Excel Discussion (Misc queries) 3 December 11th 07 05:52 AM
Macro not calculating correctly Ozgur Pars[_2_] Excel Programming 0 July 17th 06 03:53 PM
addin not running correctly sc Excel Programming 0 July 10th 06 02:54 PM
addin not running correctly sc Excel Programming 1 July 7th 06 11:50 PM
Workbook_BeforeClose change event not running correctly Peter Rooney Excel Programming 4 August 5th 05 04:26 PM


All times are GMT +1. The time now is 05:30 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"