Why does this not work?

Status
Not open for further replies.

Adrian1

Board Regular
Joined
Dec 30, 2003
Messages
126
I have a command button with the following code:

Private Sub CommandButton5_Click()

Range("index2").Value = Range("index1").Value + 1

End Sub

I would assume that this would make index2 the same value as index1+1. But for some reason, when I click on the button it gives me a 'Runtime 13' error (Type Mismatch). This has been doing my head in all day! Can someone help me please? o_O
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi There

Is index1 and index2 a named range? Do you have text value in them at all?

Kind Regards

Peter
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

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