Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default increase print range 1 column

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default increase print range 1 column

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


"cornman" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default increase print range 1 column

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")



cornman wrote:

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.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default increase print range 1 column

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

"cornman" wrote:

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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default increase print range 1 column

Try changing:

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

cornman wrote:

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

"cornman" wrote:

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.


--

Dave Peterson
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
search from range in column 1 and print from corresponding values manu Excel Discussion (Misc queries) 1 October 23rd 08 06:05 AM
How to Create Macro to Increase Cell Value to one and Print Worksheet [email protected] Excel Worksheet Functions 4 July 24th 08 08:48 PM
In excel how do I increase a number in a cell by 1 after I print? mjtaxpro New Users to Excel 4 July 26th 07 11:36 PM
Ranges, adding a column to a named print range then saving the file [email protected] Excel Programming 1 April 27th 06 01:42 AM
print 3 column range in six columns dawgpilot Excel Discussion (Misc queries) 3 April 28th 05 10:53 PM


All times are GMT +1. The time now is 03:28 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"