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: 235
Default Macro to Audit Two Columns of Data for Errors

I am trying to write a macro that would audit two columns of data for input
errors. A small data set appears below:

Code Fee
A5569 161
A5569 161
A5569 171
A2168 265
A2168 265
A2168 265
B3389 199
B3389 199

The macro should scan the first column for the same code. For each group of
same codes, it should average the corresponding values. If the average value
differs from the first value in the group, the macro should highlight the
codes and values.

For example, the macro would first scan column 1 for the first code in the
column - code A5569. It should then average the values corresponding with
that code (average of 161, 161, and 171 = 164.33). Because 164.33 differs
from 161 or 171, it should highlight code A5569 and the corresponding values
161, 161, and 171.

Once finished with that group, it should move to the next and scan code
A2168. It should average the values corresponding with that code (average of
265, 265, and 265 = 265). Because that average equals the values, there is
no input error and the macro should loop to the next code in the column -
B3389 and perform the same process again.

I'm stuck on how to analyze the data within a group of same codes and then,
once finished, move on to the next group.

Thanks for any help that can be provided.

--
John Mansfield



 
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
I'm trying to add columns and getting errors Kimb Excel Worksheet Functions 2 October 6th 08 09:58 PM
How to print the circles in formatting audit circle invalid data Creativity Excel Worksheet Functions 0 October 25th 06 02:19 AM
why does sorting large columns create errors in top selection? Mitch Excel Worksheet Functions 1 November 17th 05 08:19 PM
Macro to add data to the bottom of columns Rick Excel Discussion (Misc queries) 1 October 3rd 05 05:53 PM
Formulas returning errors when reference columns are deleted Ian M[_2_] Excel Programming 1 May 3rd 04 07:51 AM


All times are GMT +1. The time now is 08:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"