請嘗試定製您有需要,這個代碼:
(我主要的表頭是:student_id數據|名稱|姓|組)
Sub gen_reports()
Set ref_col = Application.Selection
Set ref_col = Application.InputBox("Select ID col of main table", xTitleId, ref_col.Address, Type:=8) ' select students from student_id col
For Each C In ref_col
Worksheets.Add.Name = C.Offset(0, 1) ' create a sheet for each student
ActiveSheet.Select
Range("a1").Value = "Report for " & C.Offset(0, 1) & " " & C.Offset(0, 2) & "/" & C.Offset(0, 3) ' fill each sheet with elements from each student
Next
End Sub
你可以像你一樣格式化報告(學生表)需要,以編程方式。例:範圍( 「A1」)Font.ColorIndex = 44等
細說你的問題吧。告訴我們你想要什麼。另外,如果可能的話,添加文件的屏幕截圖。 – sn152
所以,你想要去的一個表來許多張或者多張,以一張紙?對不起,謝謝 –