如何调用这个Function ,我写了xlyb(5,8) ,VB报错说要有=号怎么回事??
Private Sub Command1_Click() xlyb(5,9) '系统提示我少了=, 为什么明明是传递了两个参数,并且没有返回的值的,我该怎么去调用Function xlyb???End SubFunction xlyb(ByVal n As Integer, ByVal n2 As Integer) For I = 4 To xlsheet2.[E65536].End(xlUp).Row If xlsheet2.Cells(I, 21) <> "" And xlsheet2.Cells(I, 18) <> "" And xlsheet2.Cells(I, 20) <> "" And xlsheet2.Cells(I, 21) <= Date And xlsheet2.Cells(I, 22) = "已完成" Then 'xlsheet2.Rows(I).Copy '写裁床的' For n = 5 To 8 '先将前面的数据写到表的前面去 xlsheet1.Cells(j, n - 4) = xlsheet2.Cells(I, n) Next If xlsheet2.Cells(I, 9) <> "" And xlsheet2.Cells(I, 11) <> "" And xlsheet2.Cells(I, 11) > xlsheet2.Cells(I, 9) Then xlsheet1.Cells(j, 5) = xlsheet2.Cells(I, 9) For n = 1 To DateDiff("d", xlsheet2.Cells(I, 9), xlsheet2.Cells(I, 11)) '从第5列开始填充颜色 xlsheet1.Cells(j, n + 5).Interior.ColorIndex = 41 Next xlsheet1.Cells(j, n + 1) = xlsheet2.Cells(I, 11) '写入预计完成时间'End Function