Macro doesn't work in Excel 97

Matty2470

New Member
Joined
Mar 7, 2002
Messages
24
The following macro made for excel 2000 doesn't work in the 97 version. What do I need to change?

Sheets("Sheet2").Rows("2").ClearContents
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi

Code looks ok, so I suspect you are running the macro from an ActiveX Control. Set it's TakeFocusOnClick Propery to false or select any cell as the first line. If it's only to run a Procedure you should be able to use a CommandButton from the "Forms" toolbar.
 
Upvote 0
Also, in the VBA editor on the 97 system, check the resources menu and see if any of your resources are listed as MISSING. if they are, uncheck them and try to run it again.
 
Upvote 0
HI, thanks for the help guys. Only, when you say I am running the script from an activeX property, I just set a command button and put the clearContent action in place.

I need all people on our system to be able to use this form, so I want the form to be working and self contained, not working on one computer and not on another.

You say I should set the TakeFocusOnClick property - this is not to a command button, but to an ActiveX Property?

Iam confused.

PLease help.
 
Upvote 0
Hi

I am assuming the CommandButton you are using is from the "Control toolbar"?

While in edit mode (left most icon on the control toolbar) right click on the buttom and select "Properties" then scroll down to TakeFocusOnClick and set it to "False". Or another way is to use:

Range("A1").Select

as the first line in your row clearing code.
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,109
Members
448,548
Latest member
harryls

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