VBA Help - If .Range ("CellLink") - Application defined or object defined error

ExcelLearner_

New Member
Joined
May 23, 2018
Messages
7
Hi All,

I have created a combo box and would like to execute VBA according to selection from combo box.
I have used the same VBA code previously without any error. But since I upgrade to excel 2016 I got error message as shown below. Not sure if it's due to 64 bit system? Can anyone here shed some light, please?

Sub login()
With ActiveSheet
If .Range("celllink") = 1 Then
>> Run time error 1004. Application defined or object defined error
Call VBA_1
ElseIf .Range("celllink") = 2 Then
Call VBA_2
End If
End With
End Sub
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
What if you use

Code:
.Range("celllink").Value

?
 
Last edited:
Upvote 0
Hi JonXL,

You mean amend code to
if .range("cellLink").value = 1 ?

I amend the code to below and it works..
if .range("A1") = 1

Still don't understand why the initial coding works on previous excel version but not version 2016..
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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