|
-
Mar 26th, 2005, 04:37 PM
#1
Thread Starter
Hyperactive Member
Need VBA Code for Excel Problem?
I'm creating an Excel application and sometimes, because of the figures I put into some of the worksheets, I get the error message "#VALUE!". This isn't a problem because I know why it does it, but rather than have it say "#VALUE!" I'd rather have it say something else, in this case the text string ">50yrs".
Do I need to use VBA code to do this? I can't find a way of doing it just using the formula bar and inputting a formula.
Thanks
-Rob
Last edited by TheRobster; Mar 26th, 2005 at 05:23 PM.
-
Mar 26th, 2005, 06:22 PM
#2
Re: Need VBA Code for Excel Problem?
If you want to use the formula bar then use an If statement but you will generate a circular reference. So you
may want to use a second column for the actual numbers to display.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 28th, 2005, 11:29 AM
#3
Re: Need VBA Code for Excel Problem?
You can use ISERROR on your formula in a IF statement without creating a circular reference.
=IF(ISERROR(A1+B1),">50yrs",A1+B1)
Just replace A1+B1 with whatever your formula is in both places.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|