Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Printing A Chart

I have a date in cell JI (dd/mmm/yy) I would like to print the corresponding
months chart, which is on a separate sheet. The tabs are named *** Sept**
and *****Oct*** etc, * = letters/numbers, person who set the charts up
didn't follow the same naming method for each chart. Is it possible to
search the tabs for the three letter month abbreviation and print that
chart.

Date = 28/Sep/04 print Sep Sheet
Date = 03/Oct/04 print Oct sheet

Thanks, Jackie



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Printing A Chart

On Sun, 03 Oct 2004 12:12:26 GMT, "Jackie" wrote:

I have a date in cell JI (dd/mmm/yy) I would like to print the corresponding
months chart, which is on a separate sheet. The tabs are named *** Sept**
and *****Oct*** etc, * = letters/numbers, person who set the charts up
didn't follow the same naming method for each chart. Is it possible to
search the tabs for the three letter month abbreviation and print that
chart.

Date = 28/Sep/04 print Sep Sheet
Date = 03/Oct/04 print Oct sheet

Thanks, Jackie



Assuming the sheets to be printed are in the active workbook and that
the date is in the active sheet maybe this can be something to test.

Sub print_sheets_with_name_including_month_from_date_i n_cell_J1()
months = "janfebmaraprmayjunjulaugsepoctnovdec"
mon = Mid(months, 3 * Month(Range("J1").Value) - 2, 3)
For i = 1 To Worksheets.Count
If InStr(LCase(Worksheets(i).Name), mon) 0 Then
Worksheets(i).PrintOut
End If
Next i
End Sub

Hope this helps

Lars-Åke
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Printing A Chart

Lars-Åke Aspelin, Thanks


"Lars-Åke Aspelin" wrote in message
...
On Sun, 03 Oct 2004 12:12:26 GMT, "Jackie" wrote:

I have a date in cell JI (dd/mmm/yy) I would like to print the

corresponding
months chart, which is on a separate sheet. The tabs are named ***

Sept**
and *****Oct*** etc, * = letters/numbers, person who set the charts up
didn't follow the same naming method for each chart. Is it possible to
search the tabs for the three letter month abbreviation and print that
chart.

Date = 28/Sep/04 print Sep Sheet
Date = 03/Oct/04 print Oct sheet

Thanks, Jackie



Assuming the sheets to be printed are in the active workbook and that
the date is in the active sheet maybe this can be something to test.

Sub print_sheets_with_name_including_month_from_date_i n_cell_J1()
months = "janfebmaraprmayjunjulaugsepoctnovdec"
mon = Mid(months, 3 * Month(Range("J1").Value) - 2, 3)
For i = 1 To Worksheets.Count
If InStr(LCase(Worksheets(i).Name), mon) 0 Then
Worksheets(i).PrintOut
End If
Next i
End Sub

Hope this helps

Lars-Åke



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Printing A Chart

Lars-Åke

Code worked great but I have found there are several charts with the month
and they all print. Charts can there be something like RC*** "mon" **.
Hall**** "mon"*** etc *=wildcards.
can chart be found with specific letters *RC*** and "mon"** to be printed

Thanks, Jackie

"Jackie" wrote in message
o.uk...
Lars-Åke Aspelin, Thanks


"Lars-Åke Aspelin" wrote in message
...
On Sun, 03 Oct 2004 12:12:26 GMT, "Jackie" wrote:

I have a date in cell JI (dd/mmm/yy) I would like to print the

corresponding
months chart, which is on a separate sheet. The tabs are named ***

Sept**
and *****Oct*** etc, * = letters/numbers, person who set the charts up
didn't follow the same naming method for each chart. Is it possible to
search the tabs for the three letter month abbreviation and print that
chart.

Date = 28/Sep/04 print Sep Sheet
Date = 03/Oct/04 print Oct sheet

Thanks, Jackie



Assuming the sheets to be printed are in the active workbook and that
the date is in the active sheet maybe this can be something to test.

Sub print_sheets_with_name_including_month_from_date_i n_cell_J1()
months = "janfebmaraprmayjunjulaugsepoctnovdec"
mon = Mid(months, 3 * Month(Range("J1").Value) - 2, 3)
For i = 1 To Worksheets.Count
If InStr(LCase(Worksheets(i).Name), mon) 0 Then
Worksheets(i).PrintOut
End If
Next i
End Sub

Hope this helps

Lars-Åke





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Printing A Chart

Maybe...

Option Explicit
Sub print_sheets_with_name_including_month_from_date_i n_cell_J1_v2()
Dim myStr As String
Dim wks As Worksheet

'get the month string from J1
myStr = Format(Worksheets("sheet1").Range("j1").Value, "mmm")

myStr = "*rc*" & myStr & "*"
For Each wks In ActiveWorkbook.Worksheets
If LCase(wks.Name) Like LCase(myStr) Then
wks.PrintOut preview:=True
Exit For 'only one to print???
End If
Next wks

End Sub

If you have more than one worksheet that can match your naming convention,
remove the "exit for" line.

And remove the preview:=true after you've tested it. (No sense killing trees!)

Jackie wrote:

Lars-Åke

Code worked great but I have found there are several charts with the month
and they all print. Charts can there be something like RC*** "mon" **.
Hall**** "mon"*** etc *=wildcards.
can chart be found with specific letters *RC*** and "mon"** to be printed

Thanks, Jackie

"Jackie" wrote in message
o.uk...
Lars-Åke Aspelin, Thanks


"Lars-Åke Aspelin" wrote in message
...
On Sun, 03 Oct 2004 12:12:26 GMT, "Jackie" wrote:

I have a date in cell JI (dd/mmm/yy) I would like to print the

corresponding
months chart, which is on a separate sheet. The tabs are named ***

Sept**
and *****Oct*** etc, * = letters/numbers, person who set the charts up
didn't follow the same naming method for each chart. Is it possible to
search the tabs for the three letter month abbreviation and print that
chart.

Date = 28/Sep/04 print Sep Sheet
Date = 03/Oct/04 print Oct sheet

Thanks, Jackie



Assuming the sheets to be printed are in the active workbook and that
the date is in the active sheet maybe this can be something to test.

Sub print_sheets_with_name_including_month_from_date_i n_cell_J1()
months = "janfebmaraprmayjunjulaugsepoctnovdec"
mon = Mid(months, 3 * Month(Range("J1").Value) - 2, 3)
For i = 1 To Worksheets.Count
If InStr(LCase(Worksheets(i).Name), mon) 0 Then
Worksheets(i).PrintOut
End If
Next i
End Sub

Hope this helps

Lars-Åke




--

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
chart printing Frustrated Frank[_2_] Charts and Charting in Excel 1 May 1st 09 04:34 PM
Chart printing rtiguy Charts and Charting in Excel 0 September 3rd 08 07:52 PM
Printing Chart Owen[_2_] Charts and Charting in Excel 0 May 3rd 08 01:08 PM
Printing a chart Griffin Excel Discussion (Misc queries) 0 November 21st 06 01:25 PM
Not all of chart printing jgsharp Charts and Charting in Excel 2 July 6th 05 02:21 PM


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