![]() |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 09:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com