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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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