Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Macro to include more cells for selection to print

Joel,
Thank you for that... 'ya know, I've actually used a named range in one of
my own macros before, just did'nt click until I read your reply.
Cheers
Driftwood

"Joel" wrote:

The macro is using the named range CalendarSheet.range("ValidDays"). You can
manually change this range from the worksheet menu Insert - Name - Define and
change the range.


"Driftwood" wrote:

Hello,
I am by no means a macro expert, just know enough to be dangerous.
I have a macro for a calendar, that looks at all comments in the sheet, then
prints them on a new sheet with the date that they were inserted into.
My delemma is that The Calendar sheet I found ( and then altered) had one
month per sheet.
I put the whole calendar on one sheet, but it will only read notes from
January.

My cells go from B5:AF32 for the calendar dates, whereas the previous one
was only for B5:H10.
Nowhere in the Sub do I see a reference to rows & columns so I can expand
the cells to print from, should there be a comment in them.
What would I have to change in this Sub to make it run through all the cells
and pick out the dates with comments in them, and then list them.

Thank You
Driftwood




Sub FormatForPrinting()
Dim UserSheetCount As Long
Dim cell As range
Dim r As Long, c As Integer
Dim CalendarSheet As Worksheet
Set CalendarSheet = ActiveSheet
UserSheetCount = Application.SheetsInNewWorkbook
Application.SheetsInNewWorkbook = 1
Workbooks.Add
Application.SheetsInNewWorkbook = UserSheetCount
Cells(1, 1) = "'" & Format(CalendarSheet.range("MonthName"), "mmmm yyyy")
Cells(1, 1).Font.Bold = True
r = 3
c = 1
For Each cell In CalendarSheet.range("ValidDays")
If CellHasComment(cell) Then
If cell.Comment.Text < "" Then
Cells(r, c) = Format(CalendarSheet.range("MonthName"),
"mmmm") & " " & cell.Text
Cells(r, c + 1) = cell.Comment.Text
r = r + 1
End If
End If
Next cell
Columns("B:B").ColumnWidth = 30
Cells.EntireRow.AutoFit
range("A1").Select
End Sub

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
Select Wich Cells To Include In Print Mathew P Bennett Excel Discussion (Misc queries) 2 August 15th 08 07:44 PM
Print dialog box selection macro I think I need to rephrase the question Excel Discussion (Misc queries) 2 November 4th 07 11:31 PM
How can I print frozen panes to appear above print selection in Ex Snr Franco Excel Discussion (Misc queries) 1 April 2nd 06 03:06 PM
Macro to include Close Print Preview Vic Charts and Charting in Excel 1 January 9th 06 01:06 AM
How do I include an all tab in a pivot variable selection Userx Excel Discussion (Misc queries) 1 September 26th 05 01:03 PM


All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"