|
楼主 |
发表于 2023-5-5 21:01
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 修改页眉页脚()
' 快捷键: Ctrl+Shift+J
'
'SD-MAL-CEPC-ST-1090 渤中28-2南CEPC组块EL.(+)32000甲板板施工料单(CN-USP-BHB-BZ28-2S) REV1
'
Dim K, L, M, N, NN, NNN, MM, MMM As String
K = ActiveWorkbook.Name '全称 SD-MAL-CEPC-ST-1090 渤中28-2南CEPC组块EL.(+)32000甲板板施工料单(CN-USP-BHB-BZ28-2S) REV1.XLS
L = Split(K, " ")(0) '文件英文名 SD-MAL-CEPC-ST-1090
M = Split(K, " ")(1) '除英文名的全称 渤中28-2南CEPC组块EL.(+)32000甲板板施工料单(CN-USP-BHB-BZ28-2S)
MM = Split(K, " ")(2) 'REV1.XLS
MMM = Split(MM, ".")(0) 'REV1
N = Split(M, "单")(0) & "单" '中文名 渤中28-2南CEPC组块EL.(+)32000甲板板施工料单
NN = Split(N, "块")(0) & "块" '渤中28-2南CEPC组块
NNNN = Split(M, "块")(1) 'EL.(+)32000甲板板施工料单
NNNNN = Split(NNNN, "施")(0) 'EL.(+)32000甲板板
NNN = Split(M, "单")(1) '地理信息 (CN-USP-BHB-BZ28-2S)
With Sheet2.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
Sheet2.PageSetup.PrintArea = ""
.LeftHeader = "海洋石油工程(青岛)有限公司"
.CenterHeader = N
.RightHeader = L & Chr(10) & MMM
.LeftFooter = N
.CenterFooter = ""
.RightFooter = "第" & "2" & "页 共" & "2" & "页"
Sheet1.Range("F14") = NN & Chr(10) & NNNNN & Chr(10) & "施工料单" & Chr(10) & NNN
Sheet1.Range("g18") = L
End With
End Sub
|
|