Created
December 11, 2023 20:42
-
-
Save elbeicktalat/39f233023c8832b6262d999289c64110 to your computer and use it in GitHub Desktop.
Insert BarCode (image) into Excel Sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub InsertBarCode() | |
' Delete all inserted pictures, this will help us to delete BarCodes before creating new one. | |
ActiveSheet.Pictures.Delete | |
' Your data, can be whatever such as color, style number etc. | |
Data = Cells(2, 1) | |
FilePath = "https://barcode.tec-it.com/barcode.ashx?data=" & Data | |
' Inserts the BarCode (image) with specific size & position and rotation. | |
With ActiveSheet.Shapes.AddPicture(FilePath, msoFalse, msoTrue, 90, 30, 140, 40) | |
ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Rotation = -90 | |
End With | |
End Sub |
Author
elbeicktalat
commented
Dec 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment