我需要一个条形码生成的页眉或页脚是基于单元格B5中的数值。此值将有所不同。我可以让单元格值填充或条形码字体显示与设置值,但不能让它做这两件事。请帮助和建议是赞赏。
Sub barcode()
' this one works for the value
With ActiveSheet.PageSetup
.CenterHeader = Range("B5").Value
End With
End Sub
Sub test() ' this one works great for the font
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "&""IDAutomationHC39M Free Version,Regular""rw"
End With
End Sub
Sub test2() ''Trying to put them together though just clears the header completely
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "&""IDAutomationHC39M Free Version,Regular" & Range("B5").Value
End With
End Sub
1条答案
按热度按时间iq0todco1#
我没有这种字体,但当我试图设置我的标题与
它清除了报头-即重现了你的问题实验让我发现
换句话说-你需要给予它一个大小以及字体名称(和文本)