Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Need Help Making a Macro Repeat Until All Rows Are Processed

Hello.

I have a spreadsheet that contains many records... one record per row.
When I place my cursor in one of the rows, I can invoke a macro that
prints a barcode sheet for the ONE record in that row.

However... now I need to print a barcode sheet for ALL of the records
(and there are hundreds of them). Is there any way to modify the
following macro so that it will print a barcode sheet for ALL of the
records in one batch (instead of my having to manually run the macro
for each row)?

Any help would be greatly appreciated! Thanks,
Jessi


THE MACRO:

Sub PrintBarcode()

'Dimension the variables:
Dim iOffsetValue As Integer

'Get the row number and save to the iOffsetValue variable (you must
subtract one to account for the header row):
iOffsetValue = ActiveWindow.ActiveCell.Row - 1
'Make the barcode sheet visible:
Sheets("BarcodeSheet").Visible = True
'Select the barcode sheet:
Sheets("BarcodeSheet").Select
'Select the offset adjustment cell:
Range("M2").Select
'Place the offset value:
ActiveCell.FormulaR1C1 = iOffsetValue

'Print and hide the barcode sheet:
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("BarcodeSheet").Visible = False
'ActiveWindow.SelectedSheets.Visible = False
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
repeat two rows macro please jwmbem New Users to Excel 3 March 9th 08 04:02 PM
need macro :repeat rows at top jwmbem New Users to Excel 0 March 8th 08 07:33 PM
Display current sheet name being processed in macro Ann New Users to Excel 5 April 17th 07 01:18 PM
repeat macro for all rows Rick Billingsley[_2_] Excel Programming 3 November 16th 05 03:29 PM
Foreign characters aren't processed in a macro Paul hampson Excel Programming 0 August 12th 04 01:43 PM


All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"