macro, make a button for printing cells c3:g10?


Posted by espen on January 06, 2001 11:28 PM

Q1:Is there a macro that I can use so a given area will be printed? I have ten such areas on each sheet, and would like to have an easy way to print any of those areas by clicking that button.

Q2:I've several times tried to do conditional formating cells, but it seems like the sheet has a limit to the number of such formulas? Is this the fact?
The program says that it "can not save all the data or formulas you've entered" etc etc

Hope someone can help me, I'm pretty fresh at excel, and have a billion of questions.

Thanks
Espen

Posted by Dave Hawley on January 07, 2001 12:27 AM

Hi Espen

Question1:
As printing ranges often involves retaining print settings etc, I believe you should take a look at "Report Manager" and "Custom Views". These 2 Excel features are designed for exactly this. They can both be found under "View" on the toolbar. If "Report Manager" is not there you will need to go to Tools>Add-ins and select it, then look again. Excels help on this feature is pretty clear, but if you run into problems just yell.


Question2
Conditional Formating has a limit of 3 conditions, but you would know this before you tried to save. You maybe trying to save in version that doesn't support some of your data?

Here are some of Excels limits
Maximum number of colors in a workbook: 56

Maximum number of custom number formats: Limited by available memory

Maximum number of cell styles in a workbook: 4,000

Maximum number of names in a workbook: Limited by available memory


To see the complete list Push F1 and type: Specifications.


Hope this helps
Dave
OzGrid Business Applications

Posted by espen on January 07, 2001 11:50 AM

Hi Dave

Thanks. I've noe tried the report manager, and if only the printer would cooperate.... Now I have another question: Can I make a button on top of every area, so instead of going through the report manager, I rather can click on those buttons. I have 10 such areas on every sheet, and would like them to be printed seperately and in any condition that the user may find practical.

And back to my other problem, which has caused me a lot of extra work: I did coditional formating to change the color if a give cell contained the letters p, pm, k, f,or x. Is it possible to "overdo" this, I copyed the formulas to a great number of cells, and the computer could not save the data. When I checked "go to" and "specials" I found that it was most like a random choice by the computer whether the cells was cond. formt. Can it be a result of to large formulas in many cells + to large cond. formt.?

Ok, I've asked so many questions now that I might as well give you my creditcard number.

greetings from norway
espen

Posted by Dave Hawley on January 07, 2001 8:47 PM

Hi Espen

For question 1 the answer is yes.

1. Push Alt+F11 and go to Insert>Name>Define and paste in this code as many times as you have ranges to print:

Sub PrintRange()
With ActiveSheet
.PageSetup.PrintArea = ""
.PageSetup.PrintArea = "$A$1:$D$9"
Application.Dialogs(xlDialogPrintPreview).Show
.PageSetup.PrintArea = ""
.DisplayPageBreaks = False
End With
End Sub

2. Change all PrintArea ranges to suit. But leave the [.PageSetup.PrintArea = ""] as is.

3. Give the Procedures DIFFERENT one word names. E.g change "MyPrintRange" to MyPrintRange1 etc.


4. Push Alt+Q and then go to View>Toolbars>Forms. Double Click the "Button" and paste in the cell you want it. Click the Macro name to assign to this button and then OK.

5. Click the next cell you want a Button and again assign the macro. When you have finished push Esc to remove the button from your cipboard.

6.Right click on each button and select "Format Control". and make any changes.


7. Save.

Question 2

I'm not to sure I understand you but.... I doubt that Excel has reached a cell limit for Conditional Formatting, unless you have applied it to the entire sheet? But as I said before you can only set 3 conditions for any one range.

Try this

1. Highlight you entire worksheet i.e Ctrl+A.

2. Go to Format>Conditional Formatting. Select Delete, select all 3 conditions, the OK and Ok again. This will remove all you conditional formatting, now Save.


You will have to redo your Conditional formatting.

Select the range to apply the Conditional Formatting before activating Data>Conditional Formatting. then set your condition.

If you range was A1:H500 then with that range highlighted you would use the "Formula is" with:
FALSE

DO NOT abosolute A1 like $A$1.

Set you format and click OK.


I have some examples and links of my Web site that may be of use to you regarding "Conditional Formatting". Just click my link and then click "Handy Hints"

Good Luck
Dave
OzGrid Business Applications

Posted by espen on January 07, 2001 10:37 PM

THANKS DAVE

I will try the suggestion, if I'm able to figure it out. And I'm going to your homepage to learn more about the conditional formating.

espen



Posted by espen on January 08, 2001 4:17 AM

Hi Dave

When I push Alt+F11 and try to go to Insert, there is no "name" displayed.

Hmm?

Have a nice day.

espen