gpt4 book ai didi

excel - 尝试运行宏时出错,编译错误:语法错误

转载 作者:行者123 更新时间:2023-12-02 10:56:26 26 4
gpt4 key购买 nike

我正在Excel VBA上在线类(class),并且是一个完整的初学者。第一个任务是设置并运行一个基本的宏,该宏将创建一个带有特定字体大小等标题的电子表格。不幸的是,当我运行宏时,出现如下所示的编译器错误。我还包括了出现在编译器窗口中的代码。

Sub InsertSheet()
'
' InsertSheet Macro
'
' Keyboard Shortcut: Ctrl+Shift+I
'
("Purpose").Count
.
ShowDrillIndicators. = "Header Placeholder"
Item(SortUsingCustomLists, SortUsingCustomLists.(xlToLeft)).Count
Item(SortUsingCustomLists, SortUsingCustomLists.(xlToLeft)).Count
Range("A1:B1").Count
Range("B1").ColumnWidth
SortUsingCustomLists.Color. = 12
SortUsingCustomLists.Color. = 14
SortUsingCustomLists.Color. = TRUE
Range("A1:E1").Count
SortUsingCustomLists.Visible(xlDiagonalDown).Address = xlNone
SortUsingCustomLists.Visible(xlDiagonalUp).Address = xlNone
SortUsingCustomLists.Visible(xlEdgeLeft).Address = xlNone
SortUsingCustomLists.Visible(xlEdgeTop).Address = xlNone
With SortUsingCustomLists.Visible(xlEdgeBottom)
.Address = xlContinuous
.ActiveSheet = 0
.DecimalPlaces = 0
.Type = xlThin
End With
SortUsingCustomLists.Visible(xlEdgeRight).Address = xlNone
SortUsingCustomLists.Visible(xlInsideVertical).Address = xlNone
SortUsingCustomLists.Visible(xlInsideHorizontal).Address = xlNone
. = FALSE
Range("D3").Count
End Sub
enter image description here
我使用的是便携式笔记本电脑,是否可能没有管理权限,这可能会导致某种错误?您能提供的任何帮助将不胜感激。抱歉,如果格式设置不正确,我是这个网站的新手。

最佳答案

我收到了类(class)提供者的答复,他们向我发送了应该由宏记录器创建的代码,因为你们怀疑它与我的代码有很大不同。他们说,代码中的语法很可能表明我需要修复Excel版本。我还没有机会尝试这个,但是希望它能起作用。感谢您的帮助!

关于excel - 尝试运行宏时出错,编译错误:语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62637819/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com