increase print range 1 column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to have a macro to print a daily activity sheet. The macro
needs to delete the column that is seven days old, then reset the print range
to include an additional day(today). The print range includes several
columns on the left that are printed each time.
 
cornman,

Assuming on Sheet1 columns A:D are static, column E is the first "daily"
column and K is the last. So prior to today, your print range was
"A1:K(lastrow)" where lastrow is the last row in your print range. Assuming
you want to delete column E and then have the data that was in column L (now
in K) be added to the print area. You macro would look like this if your
'lastrow' 23

Sub UpdateDaily()
Sheets("Sheet1").Range("E:E").Delete
Sheets("Sheet1").PageSetup.PrintArea = "$A$1:$K$23"
End Sub

Mike
 
I don't know what column you want deleted, so I deleted column D!

Option Explicit
Sub testme02()

Dim wks As Worksheet
Set wks = Worksheets("Sheet1")

With wks
With .Range("Print_Area")
.Resize(, .Columns.Count + 1).Name = .Name.Name
End With
.Range("D1").EntireColumn.Delete
End With

End Sub

..Name gives the address (like =sheet1!$a$1:$j$999
..name.name gives the name of the range ("Print_Area")
 
Sorry, what I needed to say was hide the old column. I need to keep the
older information, so I have columns on the left that are not in the print
range, then columns that are in the print range, and among them some hidden
columns. I want to be able to print 7 consecutive days. The columns to the
right, out of the print range, have consecutive dates in them, so that cells
in the columns can remind about about future events.
THanks
 
Try changing:

..Range("D1").EntireColumn.Delete
to
..Range("D1").EntireColumn.hidden = true
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top