[已解决]请教EXCEL自定义函数,有没有用来清除指定单元格内容的?
本帖最后由 smooth 于 2013-5-10 09:18 编辑请教EXCEL自定义函数,有没有用来清除指定单元格内容的?帮助里那几个函数我看了,都没有。谢谢! range("a1").clearcontents 清格单元格
range("a1").clear 清除全部(内容、格式、边框等) 回复 2# kevinch
非常感谢,请问这些用法在哪里可以找到,帮助里好像没有。 能分清方法,事件,属性,集合之类的后,可以到帮助文件的方法里去找 回复 4# kevinch
所言极是,谢谢! 回复 5# smooth
還有個方法...請用EXCEL 錄製 巨集然後 操作你想操作的,然後停止錄製巨集,再去編輯你剛剛錄製的巨集,就可以看到 剛剛錄製的東西,然後再稍微轉換一下 就可以用在AU3上了,絕大部分的基礎操作 用這個方法 就可以知道了 回复 6# kk_lee69
不好意思,请问什么叫錄製 巨集 ?是录制宏么? 回复 7# smooth
恩就是 宏................台灣叫做 巨集 回复 8# kk_lee69
OK,感谢台湾的兄弟啦!有不懂再请教你。 回复 8# kk_lee69
兄弟,如何将下面这段宏代码,写成AU3格式?没这么玩过。
Sub 宏1()
'
' 宏1 宏
'
'
Columns("A:A").EntireColumn.AutoFit
Columns("G:G").EntireColumn.AutoFit
Columns("F:F").EntireColumn.AutoFit
Columns("E:E").EntireColumn.AutoFit
Rows("1:13").Select
Selection.RowHeight = 17
Range("C2:D4").Select
Selection.NumberFormatLocal = "#,##0.00_ "
Range("F2:G4").Select
Selection.NumberFormatLocal = "#,##0.00_ "
Range("C6:D8").Select
Selection.NumberFormatLocal = "#,##0.00_ "
Range("F6:G8").Select
Selection.NumberFormatLocal = "#,##0.00_ "
Range("C10:D10").Select
Selection.NumberFormatLocal = "#,##0.00_ "
Range("F10:G10").Select
Selection.NumberFormatLocal = "#,##0.00_ "
Range("C12:D13").Select
Selection.NumberFormatLocal = "#,##0.00_ "
Range("F12:G13").Select
Selection.NumberFormatLocal = "#,##0.00_ "
Range("C5:D5").Select
Selection.NumberFormatLocal = "0.00%"
Range("F5:G5").Select
Selection.NumberFormatLocal = "0.00%"
Range("C9:D9").Select
Selection.NumberFormatLocal = "0.00%"
Range("F9:G9").Select
Selection.NumberFormatLocal = "0.00%"
Range("C11:D11").Select
Selection.NumberFormatLocal = "0.00%"
Range("F11:G11").Select
Selection.NumberFormatLocal = "0.00%"
Range("E2:E13").Select
Selection.NumberFormatLocal = "0.00%"
Range("H2:H13").Select
Selection.NumberFormatLocal = "0.00%"
Range("C2:H13").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("D8").Select
Range("A1:H13").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Range("D5").Select
End Sub 你這是設定格式 畫線.......
這些都屬於基礎操作 有個 文章 可以先寄住
http://www.autoitx.com/forum.php?mod=viewthread&tid=16616&highlight=EXCEL
另外我要說的意思是 譬如 你剛剛上面錄下的 其中
Range("C9:D9").Select
Selection.NumberFormatLocal = "0.00%"
其實轉換成 AU3語法就變成
$oexcel.Range("C9:D9").NumberFormatLocal = "0.00%"
變成這樣的一行
至於怎麼便 多看多練習重點是至少有方向 可以測試
页:
[1]