ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   printing single row only (https://www.excelbanter.com/excel-programming/378604-printing-single-row-only.html)

AOU

printing single row only
 
I have a form thta data is entered daily. Is there a way that I can print the
form out. Then as data is entered, I insert the printed form in the printer
and only print the new data on the form.
--
AOU

JLGWhiz

printing single row only
 
I am not sure that falls under Excel Programming.

"AOU" wrote:

I have a form thta data is entered daily. Is there a way that I can print the
form out. Then as data is entered, I insert the printed form in the printer
and only print the new data on the form.
--
AOU


Ron de Bruin

printing single row only
 
It is possible with code but why not print only the last page of the sheet
with code

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
I have a form thta data is entered daily. Is there a way that I can print
the
form out. Then as data is entered, I insert the printed form in the
printer
and only print the new data on the form.
--
AOU



Ron de Bruin

printing single row only
 
Remove one ActiveSheet

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message
...
It is possible with code but why not print only the last page of the sheet
with code

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
I have a form thta data is entered daily. Is there a way that I can print
the
form out. Then as data is entered, I insert the printed form in the
printer
and only print the new data on the form.
--
AOU




AOU

printing single row only
 
I was after the ability to select the last row with data and print that rows
data only.
--
AOU


"Ron de Bruin" wrote:

Remove one ActiveSheet

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message
...
It is possible with code but why not print only the last page of the sheet
with code

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
I have a form thta data is entered daily. Is there a way that I can print
the
form out. Then as data is entered, I insert the printed form in the
printer
and only print the new data on the form.
--
AOU





Ron de Bruin

printing single row only
 
For the last row try this

Sub test()
Range("A" & LastRow(ActiveSheet)).EntireRow.PrintOut
End Sub


Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function


--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
I was after the ability to select the last row with data and print that
rows
data only.
--
AOU


"Ron de Bruin" wrote:

Remove one ActiveSheet

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message
...
It is possible with code but why not print only the last page of the
sheet
with code

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
I have a form thta data is entered daily. Is there a way that I can
print
the
form out. Then as data is entered, I insert the printed form in the
printer
and only print the new data on the form.
--
AOU





AOU

printing single row only
 
Thanks very much Ron I shall try it and let you know how I get on with it.
--
AOU


"Ron de Bruin" wrote:

For the last row try this

Sub test()
Range("A" & LastRow(ActiveSheet)).EntireRow.PrintOut
End Sub


Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function


--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
I was after the ability to select the last row with data and print that
rows
data only.
--
AOU


"Ron de Bruin" wrote:

Remove one ActiveSheet

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message
...
It is possible with code but why not print only the last page of the
sheet
with code

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
I have a form thta data is entered daily. Is there a way that I can
print
the
form out. Then as data is entered, I insert the printed form in the
printer
and only print the new data on the form.
--
AOU






Ron de Bruin

printing single row only
 
The function find the last row with data on the sheet
Maybe there is a space in a cell in the yellow bar row ?

Which row it print now ?


--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
Ron, Thank you for your troubles but I am having problems, it is printing
only a yellow bar across the page. The range in which the data is kept is
from row 19 to 42 and columns A to L. And it`s just the text I`m after.
--
AOU


"AOU" wrote:

Thanks very much Ron I shall try it and let you know how I get on with
it.
--
AOU


"Ron de Bruin" wrote:

For the last row try this

Sub test()
Range("A" & LastRow(ActiveSheet)).EntireRow.PrintOut
End Sub


Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function


--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
I was after the ability to select the last row with data and print
that
rows
data only.
--
AOU


"Ron de Bruin" wrote:

Remove one ActiveSheet

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message
...
It is possible with code but why not print only the last page of
the
sheet
with code

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl



"AOU" wrote in message
...
I have a form thta data is entered daily. Is there a way that I
can
print
the
form out. Then as data is entered, I insert the printed form in
the
printer
and only print the new data on the form.
--
AOU








All times are GMT +1. The time now is 07:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com