Select case problem Excel 2010

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,069
I use the following script in Excel 2000 and it works perfectly, for some reason in Excel 2010 version it bugs out at the case "DB", "" line, it says type mismatch.

Can anyone help to fix this as it is an important piece of code and there are another four pieces of code similar, so if it won't work for this one then it probably won't work for the others.

Code:
For i = 2 To Range("Q800").End(xlUp).Row
 If Cells(i, 17).Value > 1 Or IsEmpty(Cells(i, 1)) Then
 
 Select Case Cells(i, 1).Value
     Case "DB", ""
           Cells(i, 4).Value = Cells(i, 9).Value & Cells(i, 10).Value
           Cells(i, 5).Value = Cells(i, 11).Value
           Cells(i, 6).Value = Cells(i, 13).Value
  
End Select
End If
Next
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I tried it in Excel 2007 - no problems. What is stored in column A?
 
Upvote 0
There are values in column A that can not be moved as other script relies on the data, this is just one small piece of the code.

There must be a difference with select case statements between excel 2000 and excel 2010 version but I can't find any help to fix it.

I have to use another computer just to use the complete script which is annoying, but as the file saves me up to half an hour of my time it is really important to me.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top