How to rectify this VBA Macro compile error?

mobilepoker2

New Member
Joined
Apr 1, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I am new to Excel Macro. I recorded a very simple macro (typed 'a' in cell A1) and saved it for testing. When I run the macro, it gives me a compile error. I suppose there is something wrong with my settings. The image is attached below.

Please help me out.
1617268095867.png


Please check this short video where I recorded my screen while creating the macro.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,730
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Macro gives compile error
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 

mobilepoker2

New Member
Joined
Apr 1, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I am new to Excel Macro. I recorded a very simple macro (typed 'a' in cell A1) and saved it for testing. When I run the macro, it gives me a compile error. I suppose there is something wrong with my settings. The image is attached below.

Please help me out.
View attachment 35733

Please check this short video where I recorded my screen while creating the macro.
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Macro gives compile error
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Understood. Here are the cross-posts:

Can you please provide a solution now? This is critical for my research and I am not getting a solution anywhere else.
 

Stewes

New Member
Joined
Apr 1, 2021
Messages
1
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2010
  5. 2007
Platform
  1. Windows
  2. MacOS
Weird recording. Change:
Type. = "a"
to:
Range("A1") = "a"
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,730
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
I can only suggest that you completely remove and reinstall Office. The macro recorder shouldn't produce complete garbage like that.
 
Solution

mobilepoker2

New Member
Joined
Apr 1, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I can only suggest that you completely remove and reinstall Office. The macro recorder shouldn't produce complete garbage like that.
This worked. Although it was the last option. Thanks!
 

Watch MrExcel Video

Forum statistics

Threads
1,130,220
Messages
5,640,962
Members
417,183
Latest member
CuteLeo

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
Top