乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > VB代码出错,编译提示“在End <em>Sub</em>属性后面只能出现注释...

VB代码出错,编译提示“在End <em>Sub</em>属性后面只能出现注释...

作者:乔山办公网日期:

返回目录:excel表格制作


alt+f11,修改宏,改为修改selection

Sub Macro1()

Application.CutCopyMode = False
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub

Sub attractiveness()
Dim i As Integer
For i = 1 To 7
'set the value of cell G2 equal to i(1,2,...,7)
Range("G2") = i
'solversolve userfinish:=True
'place the attractiveness score in cell G5 into column K
Range("K" & i + 1) = Range("G5")
Next i
End Sub
Private Sub CommandButton1_Click()
attractiveness()
End Sub

这样就对
文本函数?合格率?

能说的再详细一些么?别人才好理解你的意思

一段代码里不能同时出现两个sub,请看这里,

有两个sub,只要删除一个就可以了。

很高兴为你解答,希望能帮到你!

相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网