Getting highlighted address range in VB


Posted by John on April 05, 2000 6:06 AM

I am trying to get the seleceted range of worksheets
cells into VB. I tryed
Worksheets("Sheet1").Activate
MsgBox ActiveCell.Address
but I just get the leftmost upper cell.

This is what I want the macro to do.

I select a range of cells containing certain data.
I Push a button and the macro takes that
range does a set print area and then prints it.

Thanks for all your help in advance
John



Posted by Celia on April 05, 2000 8:12 AM

John

'set print area
ActiveSheet.PageSetup.PrintArea = Selection.Address
'print
ActiveSheet.PrintOut

Celia