![]() |
Printing
How to set a button in excel to print a specified area, for eg if i click on
a colum (say, A5), i need to print a specified area immediately.. Please help on this topic -- Life isa journey not a destination |
Printing
you can just name range to be print in macro like here-
Range("Range1").PrintOut Range("G3:H15").PrintOut "Sherees" wrote in message ... | How to set a button in excel to print a specified area, for eg if i click on | a colum (say, A5), i need to print a specified area immediately.. Please help | on this topic | -- | Life isa journey not a destination |
Printing
Thx for ur ans, but cud u pls educate me a little more in macro coz i dont
know anything abt macro.. I will clearly state my qn again The sheet is a long report for an year which is seperated as week1 up to week52 each week will be of a range (sayA1:H10) and on the top (say A1 wil be named Week 1).. I need to print the entire area that is A1:H10 just by clicking the cell A1(Week 1) in similar way i need to set for all the 52 weeks, just by clicking on the weeks it should print the respective weekly report. Please suggest me in simple terms -- Life isa journey not a destination "Homey" wrote: you can just name range to be print in macro like here- Range("Range1").PrintOut Range("G3:H15").PrintOut "Sherees" wrote in message ... | How to set a button in excel to print a specified area, for eg if i click on | a colum (say, A5), i need to print a specified area immediately.. Please help | on this topic | -- | Life isa journey not a destination . |
Printing
A5 is a cell reference, not a column.
Record yourself setting up a printrange and printing it. Assign a button to that macro. There is another method using event code and a double-click on a cell, say A5, which will print a specified area. Gord Dibben MS Excel MVP On Thu, 10 Dec 2009 23:28:01 -0800, Sherees wrote: How to set a button in excel to print a specified area, for eg if i click on a colum (say, A5), i need to print a specified area immediately.. Please help on this topic |
Printing
maybe not posible to teach doing macros in this mesage, especlly for
somebody who english is worser than mine. joke. but like Gord say maybe try record a macro. recodred macros are not always the best but they get you going. you could even put my macro inside the one you record. you have to change the range to print in my macro of course to the one you want. "Sherees" wrote in message ... | Thx for ur ans, but cud u pls educate me a little more in macro coz i dont | know anything abt macro.. I will clearly state my qn again | The sheet is a long report for an year which is seperated as week1 up to | week52 | each week will be of a range (sayA1:H10) and on the top (say A1 wil be named | Week 1).. I need to print the entire area that is A1:H10 just by clicking the | cell A1(Week 1) in similar way i need to set for all the 52 weeks, just by | clicking on the weeks it should print the respective weekly report. Please | suggest me in simple terms | -- | Life isa journey not a destination | | | "Homey" wrote: | | you can just name range to be print in macro like here- | | Range("Range1").PrintOut | | Range("G3:H15").PrintOut | | "Sherees" wrote in message | ... | | How to set a button in excel to print a specified area, for eg if i click | on | | a colum (say, A5), i need to print a specified area immediately.. Please | help | | on this topic | | -- | | Life isa journey not a destination | | . | |
Printing
Will the ranges be different sizes?
Does the top left cell of each range have a name like Week1, Week2 etc.? Do you have these ranges named already in InsertNameDefine or just a title in a cell? Gord On Fri, 11 Dec 2009 10:20:01 -0800, Sherees wrote: Thx for ur ans, but cud u pls educate me a little more in macro coz i dont know anything abt macro.. I will clearly state my qn again The sheet is a long report for an year which is seperated as week1 up to week52 each week will be of a range (sayA1:H10) and on the top (say A1 wil be named Week 1).. I need to print the entire area that is A1:H10 just by clicking the cell A1(Week 1) in similar way i need to set for all the 52 weeks, just by clicking on the weeks it should print the respective weekly report. Please suggest me in simple terms |
Printing
Ranges are equal in size, Yes the top range has name like Week1 ,Week2... Its
just a title in a cell.. Thank u very much -- Life isa journey not a destination "Gord Dibben" wrote: Will the ranges be different sizes? Does the top left cell of each range have a name like Week1, Week2 etc.? Do you have these ranges named already in InsertNameDefine or just a title in a cell? Gord On Fri, 11 Dec 2009 10:20:01 -0800, Sherees wrote: Thx for ur ans, but cud u pls educate me a little more in macro coz i dont know anything abt macro.. I will clearly state my qn again The sheet is a long report for an year which is seperated as week1 up to week52 each week will be of a range (sayA1:H10) and on the top (say A1 wil be named Week 1).. I need to print the entire area that is A1:H10 just by clicking the cell A1(Week 1) in similar way i need to set for all the 52 weeks, just by clicking on the weeks it should print the respective weekly report. Please suggest me in simple terms . |
Printing
Couple of ways to do this.
Event code which is triggered by a double-click on a cell with the appropriate text in it..............week1 or week52.....not case-sensitive Option Compare Text Private Sub Worksheet_BeforeDoubleClick(ByVal _ Target As Range, Cancel As Boolean) If Left(Target, 4) < "week" Then GoTo ws_exit Target.Resize(10, 8).PrintOut ws_exit: Cancel = True End Sub Right-click on the Sheet tab and "View Code". Copy/paste the code into that module. Edit the resize(10, 8) to suit..............set now for a 10 row, 8 column range...........A1:H10 for example. A macro which asks for user input of week number. Sub print_week() Dim weeknum As Integer weeknum = InputBox("Enter a Number from 1 to 52") With Worksheets(1).UsedRange Set c = .Find("week" & weeknum, LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then FirstAddress = c.Address c.Resize(10, 8).PrintOut End If End With End Sub This macro would be placed in a General module in your workbook. Note.................neither has error-checking. See Ron de Bruin's site for where and how to store macros and code. http://www.rondebruin.nl/code.htm Gord On Fri, 11 Dec 2009 23:07:02 -0800, Sherees wrote: Ranges are equal in size, Yes the top range has name like Week1 ,Week2... Its just a title in a cell.. Thank u very much |
All times are GMT +1. The time now is 12:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com