Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
search from range in column 1 and print from corresponding values | Excel Discussion (Misc queries) | |||
How to Create Macro to Increase Cell Value to one and Print Worksheet | Excel Worksheet Functions | |||
In excel how do I increase a number in a cell by 1 after I print? | New Users to Excel | |||
Ranges, adding a column to a named print range then saving the file | Excel Programming | |||
print 3 column range in six columns | Excel Discussion (Misc queries) |