Set Print Area

Abdulkhadar

Board Regular
Joined
Nov 10, 2013
Messages
165
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Hello Excel Experts.........
I Want to print three rows information i.e C205, C206 & C207 after Last used B Cell in the below VB. or Print this three cells information on last page below the last B cell used.

Sub Button1_Click()
ActiveSheet.PageSetup.PrintArea = "$A$1:$N$" & Cells(Rows.Count, "B").End(xlUp).Row
Sheets("Sheet1").PrintPreview
End Sub


Thanks in advance
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Try this

Code:
Sub Button1_Click()
   Dim cel As Range:   Set cel = Range("B" & Rows.Count).End(xlUp).Offset(4)
   cel.Offset(-3).Resize(3) = Array(Range("C205"), Range("C206"), Range("C207"))
   ActiveSheet.PageSetup.PrintArea = "$A$1:$N$" & cel.Row
   Sheets("Sheet1").PrintPreview
End Sub
 
Last edited:
Upvote 0
Try this

Code:
Sub Button1_Click()
   Dim cel As Range:   Set cel = Range("B" & Rows.Count).End(xlUp).Offset(4)
   cel.Offset(-3).Resize(3) = Array(Range("C205"), Range("C206"), Range("C207"))
   ActiveSheet.PageSetup.PrintArea = "$A$1:$N$" & cel.Row
   Sheets("Sheet1").PrintOut
End Sub


Thanks for rply sir,
I want just print that cells data only, it effects the above cells when i previw or print.
Is any idea to print only data at below last B cell used.
I think the information C205, C206 & C207 type in VB.

C205 to N205
C206 to N206
C207 to N207
are mereged cells
In my sheet upt 204 row all cells are locked except col B, C, D, G & M
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,846
Messages
6,181,305
Members
453,031
Latest member
Chris_1

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