我是新来的macros,我正在创build一个macros,它需要格式化单元格,也为列A生成条形码。创build一个函数Code128()将string转换为条形码在博客中给出它工作正常。 我在下面创build的macros中使用它们 With ActiveSheet.PageSetup .PrintTitleRows = "$1:$1" .PrintGridlines = True .Orientation = xlLandscape .PaperSize = xlPaperA4 .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = False End With Columns("A").ColumnWidth = 10 For Each Target In Range("A1", Range("A" & Rows.Count).End(xlUp)) If Target.Value <> vbNullString Then Target.Value = PERSONAL.XLSB!Code128(Target.Value) Target.Resize(, 12).WrapText = True Target.Font = "Code 128" End […]
我在下面的excel visual basic中添加了一个函数,将string转换为从博客获取的条形码 Public Function Code128(SourceString As String) Dim Counter As Integer Dim CheckSum As Long Dim mini As Integer Dim dummy As Integer Dim UseTableB As Boolean Dim Code128_Barcode As String If Len(SourceString) > 0 Then 'Check for valid characters For Counter = 1 To Len(SourceString) Select Case Asc(Mid(SourceString, Counter, 1)) Case 32 To […]
我试图通过使用VBA获取Excel中生成的Code 128条形码。 我发现了一个VBA类,有人通过VBForums(后来修改为与Excel VBA一起工作)共享,但我有问题得到它的工作。 如果我在使用Excelmacros的电子表格中使用下面的代码,当在任何input上尝试使用Code128_Str()函数时,我会得到#VALUE错误。 我缺乏正确debugging代码的必要技能。 如果这个脚本可以纠正的话,我认为这对于许多人来说是非常有用的。 有问题的脚本使用免费字体生成相关的Code 128输出条形码。 参考: http : //www.barcodeman.com/info/c128.php3 (字体下载) http://www.vbforums.com/printthread.php?t=514742&pp=40&page=1 (原始论坛主题与代码) ' *** Made By Michael Ciurescu (CVMichael) *** 'Modified by Paulo Cunha (pcunha) to work with char128.ttf on word or excel on 16/05/2011 'the font at in http://grandzebu.net/index.php?page=/informatique/codbar-en/code128.htm ' References: ' http://www.barcodeman.com/info/c128.php3 Private Enum eCode128Type eCode128_CodeSetA = 1 eCode128_CodeSetB […]