Excel 2016错误地记录了我的宏 [英] Excel 2016 erroneously records my macros

查看:119
本文介绍了Excel 2016错误地记录了我的宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,请帮忙。我是VBA宏excel的新手。我正在使用Excel 2016.我正在练习如何录制宏。

我的问题是当我使用宏录制器时,它不起作用并且记录错误。

例如,即使我只记录在单元格A1中键入Test,它也会错误地执行。 

它会插入错误的代码,如下所示:



Sub Macro1()
$
'Autode1 Macro

'单元格A1中的类型测试

'键盘快捷键:Ctrl + Shift + A $
'

    .Rotation =" Test"

End Sub


我得到这个".Rotation" 


有时,在其他情况下,我会"删除"我没有删除任何单元格的代码。



请帮助。

Bob

解决方案

嗨baybobjr,



这听起来很奇怪。

我启动了宏录制器,输入"Test1" ;单元格A1和停止记录器。

在Module1中,我看到以下代码。  (我使用的是Excel 2016,32位)

 Sub Macro1()
'
'Macro1 Macro
'

'
ActiveCell.FormulaR1C1 ="测试"
范围("A2")。选择
结束子


如果您的Excel工作不正常,请修理它。

请参阅以下语言:

修复Office应用程序

https: //support.office.com/en-us/article/Repair-an-Office-application-7821d4b6-7c1d-4205-aa0e-a6b40c5bb88b



问候,


Hi guys, please help. I am new in VBA macro excel. I am using Excel 2016. I am practicing how to record a macro.
My problem is when I use the macro recorder, it doesn't work and records wrongly.
For example, even if I just record to type Test in cell A1, it does it wrongly. 
It inserts wrong codes, as shown below:

Sub Macro1()
' Macro1 Macro
' Type Test in cell A1
' Keyboard Shortcut: Ctrl+Shift+A
'
    .Rotation = "Test"
End Sub

I get this ".Rotation" 

Sometimes, in other instances, I get "Delete" codes when I didn't delete any cells.

Please HELP.
Bob

解决方案

Hi baybobjr,

It sounds strange.
I started the macro recorder, input "Test1" in cell A1, and stop recorder.
In Module1, I see the below code.  (I am using Excel 2016, 32-bit)

Sub Macro1()
'
' Macro1 Macro
'

'
    ActiveCell.FormulaR1C1 = "Test"
    Range("A2").Select
End Sub

If your Excel does not work fine, please repair it.
Refer to the following articel:
Repair an Office application
https://support.office.com/en-us/article/Repair-an-Office-application-7821d4b6-7c1d-4205-aa0e-a6b40c5bb88b

Regards,


这篇关于Excel 2016错误地记录了我的宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆