不能,你每个按钮都必须写代码。
不过你可以写少一点代码,具体情况根据你的情况而定。
编写内部函数
Dim t As Table = Args(0)
Dim l As Integer = t.LeftCol
Dim r As Integer = t.RightCol
For Each c As Col In t.cols
If c.index < l OrElse c.Index > r Then
c.Visible=False
End If
Next
t.Print(True,False)
For Each c As Col In t.cols
c.Visible=True
Next
按钮代码
Functions.Execute("函数名", Tables("表A"))