Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Autoprinter()
- ' This macro is supposed to copy cells starting
- ' from G2 to G2+i until it encounters empty cell to output cell A2
- ' and print. Rinse and repeat.
- Dim i As Long
- i = 2
- Do While Not IsEmpty(Range("G" & i))
- ' should continue until it meets empty cell
- Range("G" & i).Select
- Selection.Copy
- Range("A2").Select
- Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
- :=False, Transpose:=False 'Operation, SkipBlanks and Transpose could be ommited & xlPasteValues could be changed for xlPasteValuesAndNumberFormats
- 'https://docs.microsoft.com/en-us/office/vba/api/excel.xlpastetype
- Application.CutCopyMode = False
- ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
- IgnorePrintAreas:=False
- ' print, just from macro recorder, could be useful to rewrite
- i = i + 1
- ' looping row number
- Loop
- End Sub
Add Comment
Please, Sign In to add comment