Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8228911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:37:18+00:00 2026-06-07T16:37:18+00:00

What I have Excel 2007 worksheets. Info in Range A1:C48 (fixed) in multiple sheets

  • 0

What I have

Excel 2007 worksheets.
Info in Range A1:C48 (fixed) in multiple sheets in the same workbook.

What I need

I need to print this selection in a Letter size paper with normal margins.
But the condition is i am required to fit the width of the selection i.e. 3 columns to 1 page.
I must keep the widths of the columns constant to maintain a constant font size.
I would like to do this using VBA.

Here is the code i tried:

Sub printing()
    Dim w1 As Single, w2 As Single, w3 As Single
    Application.ScreenUpdating = False
    w1 = 62
    w2 = 24.71
    w3 = 22.14
    For i = 1 To ActiveWorkbook.Worksheets.Count
    Worksheets(i).Activate
    ActiveSheet.Columns(1).ColumnWidth = w1
    ActiveSheet.Columns(2).ColumnWidth = w2
    ActiveSheet.Columns(3).ColumnWidth = w3

    ActiveSheet.Range("A1:C48").Select

    With Worksheets(i).PageSetup
        .PaperSize = xlPaperLetter
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
        .LeftMargin = Application.InchesToPoints(0.5)
        .RightMargin = Application.InchesToPoints(0.75)
        .TopMargin = Application.InchesToPoints(1.5)
        .BottomMargin = Application.InchesToPoints(1)
        .HeaderMargin = Application.InchesToPoints(0.5)
        .FooterMargin = Application.InchesToPoints(0.5)
    End With
    Next i
    Application.ScreenUpdating = True
End Sub

While this resizes the columns and sets other properties, the page break is still left untouched and when i try to print it, column 4 is also included. I don’t want to manually drag the page break as this would resize the characters. I would prefer to set the column widths so that it will fit letter paper with normal margins.

I would really appreciate any suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:37:20+00:00Added an answer on June 7, 2026 at 4:37 pm

    If I understand correctly I think what you want is the PageSetup.PrintArea property. You could add:

    .PrintArea= "$A$1:$C$48"
    

    to your with block.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a c# code which gets the (excel-2007) worksheets used range as follows
I am using Excel 2007 with a workbook that has many sheets. I need
I have Excel 2007 and Windows XP When this code runs: Columns(A:G).Select ActiveWorkbook.Worksheets(Sheet1).Sort.SortFields.Clear ActiveWorkbook.Worksheets(Sheet1).Sort.SortFields.Add
I have an Excel 2007 ODBC connection defined and I need to allow users
Using Excel 2007 VBA Have a sheet Dashboard, have other sheets but some special
I have the following code to protect the sheets of a workbook in Excel
Using Access 2007 vba addressing an Excel 2007 workbook (WB).... This routine adds a
I have an Excel 2007 workbook which I am using to connect to a
I have an Excel 2007 workbook that contains tables of data that I'm importing
I have 2 Excel 2007 Worksheets. Excel Worksheet 1 : (as below ) 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.