macro autoprint

willsnake

New Member
Joined
Sep 9, 2014
Messages
41
Hi,

I have this Macro command:

Sub PrtLoop()
Dim bResponse As Boolean, r As Range, c As Range
On Error Resume Next
Set r = Application.InputBox("Select the cells in Project Data to process", Type:=8)
On Error GoTo 0
If r Is Nothing Then Exit Sub
With Sheets("SOE Form")
For Each c In r
.Range("A1").Value = c.Value
.PrintOut
Next c
End With
End Sub

I just want to skip the Line in RED... Instead of clicking and dragging the cell range, I would like it to auto select the cell from A6 down to any cell that has more than 0 value. if it found a zero, the macro will end.

I have been trying to find the solution for 2 days, I can't seem to find a way. Sorry to bother you with this.

Thank you in Advance for the Help...
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I got problems connecting internet so I was not able to reply. But I found a solution to my problem already...


Sub PrtLoop()
Dim bResponse As Boolean, r As Range, c As Range
On Error Resume Next
Set r = Range("a6", Range("a6").End(xlDown))
On Error GoTo 0
If r Is Nothing Then Exit Sub
With Sheets("SOE Form")
For Each c In r
.Range("A1").Value = c.Value
If c.Range("a1") = 0 Then Exit Sub
.PrintOut
Next c
End With
End Sub
 
Last edited:
Upvote 0
But i have another problem...

I have this payroll, I want a macro to print payslips, each page contains 6 payslips. So the macro above makes sequential numbering (1 then 2, then 3 and so on...). What i want now is a fixed range by 6 (1 then 7 then 13 and so on...).

I would like to ask again for your expertise about macro. I would like to seek help making a macro where I will input the 1st number then the last number separated by "-". Or input only the starting number, then the macro will work w/ the fixed range and I will find a way how to make a macro stop for certain condition...

Thank you in advance...
 
Upvote 0

Forum statistics

Threads
1,214,551
Messages
6,120,156
Members
448,948
Latest member
spamiki

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