Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default macro print area

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default macro print area

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default macro print area

Put into action got thru to printer went by a error message printed Column
(A) thru to 100 not stopping at (B) count. After print showed runtime error
1004 unable to set print area of the page set up type. Your understanding of
what is wanted is right. Still trying to figure this one. Page set up. print
area is yellowed in vba
stumped took out all of my code only have this in use. Do we need some of
what I had?
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then




with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default macro print area

found one error was a colon after a2 printed thru not useing b count as stop
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default macro print area

SorryI missed the "D". Should be...

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with
--
HTH...

Jim Thomlinson


"Curt" wrote:

found one error was a colon after a2 printed thru not useing b count as stop
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default macro print area

D made a difference all right. Don't know what is happening. Prints twice.
first run 2 sheets go to 100 next set 2 sheets stops as it should. last row
column (B) Ain't we got fun?

"Jim Thomlinson" wrote:

SorryI missed the "D". Should be...

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with
--
HTH...

Jim Thomlinson


"Curt" wrote:

found one error was a colon after a2 printed thru not useing b count as stop
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default macro print area

Not too sure what your issue might be. It works at my end...
Change printOut to PrintPreview while you are debugging to save paper. Try
stepping through the code one line at a time checking print settings as you
go...
--
HTH...

Jim Thomlinson


"Curt" wrote:

D made a difference all right. Don't know what is happening. Prints twice.
first run 2 sheets go to 100 next set 2 sheets stops as it should. last row
column (B) Ain't we got fun?

"Jim Thomlinson" wrote:

SorryI missed the "D". Should be...

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with
--
HTH...

Jim Thomlinson


"Curt" wrote:

found one error was a colon after a2 printed thru not useing b count as stop
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default macro print area

in working thru this I have noticed that when procedure runs it does show the
printer screen twice. As if the procedure is repeating . Is this possible?
Thanks


"Jim Thomlinson" wrote:

SorryI missed the "D". Should be...

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with
--
HTH...

Jim Thomlinson


"Curt" wrote:

found one error was a colon after a2 printed thru not useing b count as stop
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default macro print area

have break set on
.pagesetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
printer runs with this break in place. Seems that it should not start this
soon. chg to print preview did not stop printer. So I think printer is being
triggered by this line?
Any ideas?
Thanks

"Jim Thomlinson" wrote:

Not too sure what your issue might be. It works at my end...
Change printOut to PrintPreview while you are debugging to save paper. Try
stepping through the code one line at a time checking print settings as you
go...
--
HTH...

Jim Thomlinson


"Curt" wrote:

D made a difference all right. Don't know what is happening. Prints twice.
first run 2 sheets go to 100 next set 2 sheets stops as it should. last row
column (B) Ain't we got fun?

"Jim Thomlinson" wrote:

SorryI missed the "D". Should be...

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with
--
HTH...

Jim Thomlinson


"Curt" wrote:

found one error was a colon after a2 printed thru not useing b count as stop
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default macro print area

Don't know what it is but reduceing to this it works.

With Sheets("Check_In")
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
.pagesetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
End With

so with your help I got it
Thanks much Jim


"Jim Thomlinson" wrote:

Not too sure what your issue might be. It works at my end...
Change printOut to PrintPreview while you are debugging to save paper. Try
stepping through the code one line at a time checking print settings as you
go...
--
HTH...

Jim Thomlinson


"Curt" wrote:

D made a difference all right. Don't know what is happening. Prints twice.
first run 2 sheets go to 100 next set 2 sheets stops as it should. last row
column (B) Ain't we got fun?

"Jim Thomlinson" wrote:

SorryI missed the "D". Should be...

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with
--
HTH...

Jim Thomlinson


"Curt" wrote:

found one error was a colon after a2 printed thru not useing b count as stop
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default macro print area

Jim I changed
..PageSetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).(Row to cell)
This got print area where I wanted it
Thanks you help really appreciated.

"Jim Thomlinson" wrote:

Not too sure what your issue might be. It works at my end...
Change printOut to PrintPreview while you are debugging to save paper. Try
stepping through the code one line at a time checking print settings as you
go...
--
HTH...

Jim Thomlinson


"Curt" wrote:

D made a difference all right. Don't know what is happening. Prints twice.
first run 2 sheets go to 100 next set 2 sheets stops as it should. last row
column (B) Ain't we got fun?

"Jim Thomlinson" wrote:

SorryI missed the "D". Should be...

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with
--
HTH...

Jim Thomlinson


"Curt" wrote:

found one error was a colon after a2 printed thru not useing b count as stop
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default macro print area

having confusion with this

Sheets("Announcer").Select
Columns("F").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.MergeCells = False
End With
Range("G2").Select
Sheets("Announcer").Select
With Selection
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
.pagesetup.PrintArea = "A2:F" & Cells(Rows.Count, "B").End(xlUp).Row
End With
With ActiveSheet.pagesetup
ever so often it comes up not doing .page setup tried moving withs to
correct etc
got print ok for some reason doesn't want to count "B". still working on it.
Thanks a long way from where I started
Thanks

"Curt" wrote:

D made a difference all right. Don't know what is happening. Prints twice.
first run 2 sheets go to 100 next set 2 sheets stops as it should. last row
column (B) Ain't we got fun?

"Jim Thomlinson" wrote:

SorryI missed the "D". Should be...

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:D" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with
--
HTH...

Jim Thomlinson


"Curt" wrote:

found one error was a colon after a2 printed thru not useing b count as stop
Thanks

"Jim Thomlinson" wrote:

I am a little unclear what you want but here goes. You want to print Cells
A2:D?? where ?? is the last row in column B with a value in it... If so then

with Sheets("Check_In")
.PageSetup.PrintArea = "A2:" & Cells(Rows.Count, "B").End(xlUp).Row
.PrintOut
.PageSetup.PrintArea = ""
end with

--
HTH...

Jim Thomlinson


"Curt" wrote:

Have entries in column (A) want to stop column (A) at last row of entries in
column (B) looking thru site was unable to find an answer. site got me this
far. do need the column (A) entries. This is code I am useing.
Thanks To All

Sheets("Check_In").Select
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:D2").Resize(LastRow - 1).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
Range("F19").Select

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
Macro to hide rows with a certain cell empty then set print area and print tahrah Excel Programming 12 January 9th 07 03:47 AM
Macro - Set Print Area for Changing Data Area ksp Excel Programming 5 May 15th 06 10:20 PM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
Set Print Area Macro Grace[_4_] Excel Programming 9 June 12th 04 03:41 PM


All times are GMT +1. The time now is 07:44 AM.

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

About Us

"It's about Microsoft Excel"