excel 用vba循环语句编程绘图 用VBA编程如何遍历EXCEL每一个工作表
excel VBA\u5faa\u73af\u7f16\u7a0b\u600e\u9ebc\u5199Sub test() If [b1] + [c1] = 60 Then Exit Sub [A1] = 1 - 2 * Rnd() If [A1].Value > 0 Then [b1] = [b1] + 1 Else [c1] = [c1] + 1 End If Application.OnTime Now + TimeValue("00:00:01"), "test"End Sub
\u8fd9\u6bb5\u5c0f\u7a0b\u5e8f\u5c31\u628a\u4e00\u4e2aEXCEL\u6587\u4ef6\u4e2d\u6bcf\u4e2a\u5de5\u4f5c\u8868\u7684A1\u5355\u5143\u683c\u586b\u4e0a\u4e86a
Sub tt()
For i = 1 To ActiveWorkbook.Worksheets.Count
ActiveWorkbook.Worksheets(i).Cells(1, 1).Value = "a"
Next
End Sub
for i=4 to 34
ActiveSheet.ChartObjects("图表 1").Activate
ActiveChart.ChartArea.Copy
Cells(5, n).Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("图表 50").Activate
ActiveChart.ChartTitle.Select
Selection.Caption = sheets("顺河向绘图").cells(1,i)
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(2).Name = sheets("顺河向绘图").cells(2,i)
ActiveChart.SeriesCollection(2).Values = sheets("顺河向绘图").range(sheets("顺河向绘图").cells(3,i),sheets("顺河向绘图").cells(1828,i))
End Sub
扩展阅读:vba编程必背50个程序 ... vba while循环语句 ... vba do while跳出循环 ... vba跳出for当前循环 ... vbafor跳过本次循环 ... vba do until ... excel vba 定时 循环 ... excel vba常用的循环结构 ... vba中for循环写法 ...