Auto incrementing barcodes

tnewt

New Member
Joined
Mar 22, 2011
Messages
11
I have a spreadsheet that prints barcode sheets and would like to automate the printing with a macro if it is possible.
A1 contains my starting number that is used in conjunction with several formulas and used in the actual barcode.
A2 is the last number I would like a loop to print to.
I use a macro called printbarcode.
Is there a way to write a macro that would look at A1 and make sure it is < A2 then run the printbarcode macro then add 1 number increments updating A1 looping until it = the number in A2? Any guidance to the information to help me work thru the solution to this problem would be very much appreciated.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You could try something like this...

Rich (BB code):
Sub Increment_A1()
    With Sheets("Sheet1")
        While .Range("A1") < .Range("A2")
            printbarcode
            .Range("A1") = .Range("A1") + 1
        Wend
    End With
End Sub
 
Function printbarcode()
    'Your macro here
End Function
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,712
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top