LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default Inexplicable VBA errors in formulas

I use Excel 2002 under XP Pro SP2.

Perhaps there are some memory limits, in particular to do with
named expression/ranges -- which I use extensively -- that could
be causing unexplained corruption in my formulas when I populate
ranges via VBA.

Does anyone know, for example, why row ranges in formulas might
suddenly start showing up as Roman numerals, and relative references
go kablooey (highly technical term, there)? :-)

Here's a code snippet:

' data validation for Order #
With .Range("B2", Cells(myRow, 2))
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF(B:B,B2)1"
.FormatConditions(1).Interior.ColorIndex = 22 ' pink

.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=MOD(ROW(),2)"
.FormatConditions(2).Interior.ColorIndex = 24
End With

I run the macro. Things that should be pink aren't. I look in
the conditonal formatting for the cells in question. I see,
e.g., for cell B2:

=COUNTIF(II:II,HI3)1


Can someone explain that?!

I change that manually to

=COUNTIF(B:B,B2)1

and the row's cells format as I expected and wanted.

There are other relative-reference errors as well. I have a couple
of fairly long named expressions, which I created with the free
Add-In "Names Manger" (the current version). Could I be overrunning
some program limit and corrupting memory or something? Any ideas
would be most appreciated.

A long related posting of mine from the other day that exlains some of
the other errors is here in this group as
Message-ID: , which I posted on
the 17 July 2007.

--
dman
 
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
How do I correct rounding errors in Excel formulas? C. Van Dam Excel Worksheet Functions 1 August 29th 06 04:37 AM
Nested IF AND OR function Inexplicable error MichaelC Excel Worksheet Functions 7 August 22nd 05 10:46 PM
Handling errors in formulas (how annoying are they!) anon90210 Excel Discussion (Misc queries) 1 January 17th 05 01:26 PM
Errors in copying formulas Frequent_User Excel Discussion (Misc queries) 1 December 12th 04 12:00 AM
Unresolved Errors in IF Statements - Errors do not show in results Markthepain Excel Worksheet Functions 2 December 3rd 04 08:49 AM


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