我正在使用for循环动态更改工作表中的单元格值。在每次迭代中,我都将工作表打印到dbf文件中。该代码工作正常,除了每张纸都打印在不同的dbf文件上。我想在一个dbf文件上全部打印。
Sub Make_diary()
Dim cur_day, first_day, last_day As Date
Dim wk_day As Integer
first_day = #1/1/2018#
last_day = #12/31/2018#
For cur_day = first_day To last_day
wk_day = Weekday(cur_day)
Worksheets(wk_day).Select
Cells(1, 1) = WeekdayName(wk_day) + " " + MonthName(Month(cur_day), True) + Str(Day(cur_day))
Worksheets(wk_day).PrintOut
Next cur_day
End Sub