作者:乔山办公网日期:
返回目录:excel表格制作
1、按alt+F11打开vba编辑复器;
2、输入以下代码制
Sub 行()
MsgBox "sheet1共有知" & Sheet1.UsedRange.Rows.Count & "行记录。道"
End Sub
3、点击运行。
Sub 绿色copy变为白色()
Dim rng
For Each rng In Range("a1:z100")
If rng.Interior.ColorIndex = 10 Then
rng.Interior.ColorIndex = 2
End If
Next
End Sub
查找区域为知A1:Z100,根据实际道修改
菜单 -视图 -工具栏来- 窗体
在出来的源工具栏选按纽,然后画一个按钮.
在出来的对话框里点新建
出来的宏知
Sub 按钮1_单击()
End Sub
在中间加入道代码
Sub 按钮1_单击()
sheet2.range("a1")=sheet1.range("a1")
End Sub
子易空间站 - Excel培训专家
sub test()
dim jgarr(1 to 1000) as string
dim jgJs as integer
for each mycell in sheets(“sheet1”).cells
if mycell.font.color=? then '?绿色的色号复 自己查一下制zhidao
jgjs=jgjs+1
jgarr(jgjs)=mycell.text
endif
next mycell
'输出结果
sheets("sheet2").activate
for i=1 to jgjs
cells(i,1)=jgarr(i)
next i
end sub
随手写了一下,没有调试过