Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error Table For Excel Comparisons


This is a toughy I believe. For the past few weeks my evenings are
learning and working on a large macro to compare and verify correct use
of data in two spreadsheets within the same workbook. What I'd like to
do is create a lookup table which has my error messages in it. To go
along with the error messages its important to plant what the error is.
Example below:

Error Table -

Error 1: A, Cell B = C, Value is greater than 90
Error 2: A, Cell B = C, Value is less than 50
....
....
.... etc. - where A=sheet name, B=Cell and C= value in Cell

Listing reports error in log for error 1 (text file) below:

Error 1: Sheet1, Cell A1 = 91, Value is greater than 90

Am I making this more complex than it really is?


Learning VBA quickly and enjoying it......

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile: http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=390162

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Error Table For Excel Comparisons

Personally, I would create the error message on the fly, as the comparisons are made. For example,
with your first two messages:

For Each mySht In ActiveWorkbook.Worksheets
For Each myCell In mySht.Range("A1:A100")
If myCell.Value 90 Then
strErrMsg = mySht.Name & ", Cell " & _
myCell.Address(False, False) & _
" = " & myCell.Value & _
", Value is greater than 90"
MsgBox strErrMsg
ElseIf myCell.Value < 50 Then
strErrMsg = mySht.Name & ", Cell " & _
myCell.Address(False, False) & _
" = " & myCell.Value & _
", Value is less than 50"
MsgBox strErrMsg
End If
Next myCell
Next mySht

HTH,
Bernie
MS Excel MVP


"ajocius" wrote in message
...

This is a toughy I believe. For the past few weeks my evenings are
learning and working on a large macro to compare and verify correct use
of data in two spreadsheets within the same workbook. What I'd like to
do is create a lookup table which has my error messages in it. To go
along with the error messages its important to plant what the error is.
Example below:

Error Table -

Error 1: A, Cell B = C, Value is greater than 90
Error 2: A, Cell B = C, Value is less than 50
...
...
... etc. - where A=sheet name, B=Cell and C= value in Cell

Listing reports error in log for error 1 (text file) below:

Error 1: Sheet1, Cell A1 = 91, Value is greater than 90

Am I making this more complex than it really is?


Learning VBA quickly and enjoying it......

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile: http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=390162



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
Yr to Yr comparisons cisse_5 Excel Discussion (Misc queries) 7 May 15th 09 06:10 PM
Excel File Comparisons Twila Excel Discussion (Misc queries) 2 December 5th 08 08:42 PM
Pivot Table Comparisons in Excel 2007 whynot0611 Excel Discussion (Misc queries) 2 May 19th 07 12:51 AM
Merging Workbook Table data Based upon Value comparisons jayceejay New Users to Excel 5 January 8th 06 11:28 PM
Excel error using Dinamic Table Iván Excel Worksheet Functions 0 November 30th 04 12:37 PM


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