Re: erasing outside print area
- From: mikerickson <mikerickson.c506cf@xxxxxxxxxxxxxxx>
- Date: Mon, 25 Jun 2007 03:46:15 +0100
I think these modifications will adresss those issues.
Code:
--------------------
Dim pValues() As Variant
Dim pAddress As Variant
Dim i As Long
pAddress = Split(Active***.PageSetup.PrintArea, ",")
ReDim pValues(UBound(pAddress))
For i = 0 To UBound(pAddress)
pValues(i) = Range(pAddress(i)).Formula
Next i
Active***.Cells.ClearContents
For i = 0 To UBound(pAddress)
Range(pAddress(i)).Formula = pValues(i)
Next i
--------------------
If your version is before Excel 2003, pm me and I'll send you a Split
function.
Dave Peterson;514206 Wrote:
And watch out for multiple area print ranges.
mikerickson wrote:-
True. It sould be .Formula not .Value
Dave Peterson;514023 Wrote:-
Watch out for formulas!
mikerickson wrote:--
This works for me.
Code:
--------------------
Dim pValues As Variant
With Active***
pValues = .Range(.PageSetup.PrintArea).Value
.Cells.ClearContents
.Range(.PageSetup.PrintArea).Value = pValues
End With
--------------------
er;513921 Wrote:-
hallo,
how can erase the empty cells, outside print area?-
--
mikerickson--
--
Dave Peterson-
--
mikerickson-
--
Dave Peterson
--
mikerickson
.
- Follow-Ups:
- Re: erasing outside print area
- From: Dave Peterson
- Re: erasing outside print area
- References:
- Re: erasing outside print area
- From: mikerickson
- Re: erasing outside print area
- From: Dave Peterson
- Re: erasing outside print area
- From: mikerickson
- Re: erasing outside print area
- From: Dave Peterson
- Re: erasing outside print area
- Prev by Date: Re: Data Bars based on other cells
- Next by Date: Re: checkRepeatedValues
- Previous by thread: Re: erasing outside print area
- Next by thread: Re: erasing outside print area
- Index(es):