macros


Posted by Emma on February 07, 2002 5:55 AM

how can i write a macro that will select cells that have something in them, give me print preview and then gives me a message box with the option to print on it.



Posted by Derek on February 08, 2002 4:49 AM

I am no wiz but this doesn't sound possible. Even if all your data is on one page within a print area that you have already set, selecting occupied cells won't bring them neatly together unless you do some sort of sorting or filtering. How you do this depends on how your data is laid out.
I suggest you use the macro recorder and record the steps you would take if you did this manually and then check the code its produced in the Visual Basic Editor.
You can use Edit/GoTo/Special... to select certain areas of your worksheet - like Constants
Hope this helps a bit
Derek