Wrox Programmer Forums
|
BOOK: Excel 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Excel 2003 VBA Programmer's Reference by Paul T. Kimmel, Stephen Bullen, John Green, Rob Bovey, Robert Rosenberg, Brian Patterson; ISBN: 9780764556609
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel 2003 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 11th, 2009, 01:04 PM
Registered User
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default range.hasformula unexpected results

Sub test()
ActiveSheet.Cells.Clear
Range("$B$2:$B$3").Formula = "=9"
Debug.Print Range("$A$1:$A$3").HasFormula
Debug.Print Range("$B$2:$B$3").HasFormula
Debug.Print Range("$A$1:$B$3").HasFormula
Debug.Print Range("$B$2:$C$4").HasFormula
End Sub


False
True
Null
True

The first 3 results are as expected. The fourth I would expect to be Null.

If you now manually set $C$4 to 1 and rerun (bearing in mind the ActiveSheet.Cells.Clear) the results are

False
True
Null
Null

Its as if its doing an intersection with Used Range before looking for formula.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected error ramkris84 ASP.NET 1.0 and 1.1 Professional 2 April 19th, 2008 04:48 AM
Edit Query Results in Results Grid druid2112 SQL Server 2005 1 June 28th, 2007 08:49 AM
Filter grid view results by range of values srinredd59 ASP.NET 2.0 Professional 0 December 27th, 2006 03:55 PM
Filter GridView Results by date range srinredd59 ASP.NET 2.0 Basics 0 December 27th, 2006 03:53 PM
Unexpected T_VARIABLE deamato BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 26th, 2005 08:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.