We help IT Professionals succeed at work.

Added lines and columns and now custom 0000-00-00 routine does not work. Now, all numeric entries are getting an error.

Last Modified: 2018-09-25
I had a GREAT spreadsheet until I added some lines and columns.  

In the account number fields (found throughout) when you entered 1234
you got 1234-00-00
When you entered 12
you got 1200-00-00
When you entered 123456
you got 1234-56-00

Suddenly, not only is that routing not working, once active content is enable, any entry to a custom or numeric field gets a Debug error. Sample spreadsheet is attached.

I know the problem is in VBA, but even when I update the routine with the appropriate cell numbers, ranges, I still get the error.
Watch Question

Roy CoxGroup Finance Manager

Why use VBA, I would use a Custom Number Format. I'll take a look
Analyst Assistant
This one is on us!
(Get your first solution completely free - no credit card required)
Roy CoxGroup Finance Manager

The range is hard coded in the VBA, so it needs amending. I have started to create a Named Range  called ACCOUNTNUM, but I'm not sure what the complete range for account  numbers is.
Bill GoldenExecutive Managing Member


Norie, thank you very much. That solved the immediate problem.

Roy, that is a great idea. Would I be entering the range values somewhere within the worksheet itself?

Roy CoxGroup Finance Manager

To create the Named Range, select all the cells that you want to be affected by the code. Then in the Name Box (top left below the Ribbon) type the name for the range.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.