这是我正在使用的代码。
它工作正常,但我需要知道排除列标题需要哪些额外代码。
Private Sub Command104ContrDonatWeekly_Click()
On Error GoTo Command104ContrDonatWeekly_Click_Err
DoCmd.OpenQuery "Contributors Who Donated in Past Week", acViewNormal, acEdit
xlfile = "C:\Users\Michael1\Desktop\KSN\DistributionListWeekly.xlsb"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, _
"Contributors Who Donated in Past Week", xlfile, True, "EmailList"
Shell "Excel.exe " & xlfile, vbNormalFocus
Command104ContrDonatWeekly_Click_Exit:
Exit Sub
Command104ContrDonatWeekly_Click_Err:
MsgBox Error$
Resume Command104ContrDonatWeekly_Click_Exit
End Sub
这是一些代码
如何编写 VBA 代码以隐藏 Excel 中的所有列和行标题?
我不太清楚它需要与我已经使用的代码一起放在哪里。
Private Sub hideHeadings()
Dim wrkbk As Workbook
Dim wrksh As Worksheet
Dim prev As Window
Set prev = ActiveWindow
For Each wrkbk In Workbooks
For Each wrksh In wrkbk.Worksheets
wrksh.Activate
ActiveWindow.DisplayHeadings = False
Next wrksh
Next wrkbk
prev.Activate
End Sub