📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Why is VBA programming in Excel 2003 a pain?

I've recently moved over from Excel 2000 to Excel 2003.

I now find that when programming even simple VBA macros i get 'Type mismatch' error or one of a host of other errors.

It is really annoying.

I have written more complex routines in Excel 2000 previously and had no such errors.

Does Excel 2003 have some new bugs or something? Because now programming even simple routines has become a pain!

Thanks to anyone who can help!


L


P.S Here is one macro which doesn't work:


Option Explicit

Dim i As Variant
Dim j As Variant

Sub COUNT()

i = 0

For j = 1 To 1000

If Cells(j, 8).Value = "M" Or "S" Or "A" Or "Q" Then
i = i + 1
End If


Next j



Cells(1, 6) = i

End Sub
"To be ignorant of one's ignorance is the malady of the ignorant." Amos Bronson Alcott

Comments

  • Change
    If Cells(j, 8).Value = "M" Or "S" Or "A" Or "Q" Then
    to:

    If Cells(j, 8).Value = "M" Or Cells(j, 8).Value = "S" Or Cells(j, 8).Value = "A" Or Cells(j, 8).Value = "Q" Then
This discussion has been closed.
★ ★ ★ Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 356K Banking & Borrowing
  • 255K Reduce Debt & Boost Income
  • 456.3K Spending & Discounts
  • 248.5K Work, Benefits & Business
  • 606.2K Mortgages, Homes & Bills
  • 179.1K Life & Family
  • 264K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.7K Read-Only Boards
Quick Search

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.