Changing filtered cells
Range("YourColumnRange").ClearContents ' erases all cells, hidden or not
Range("YourColumnRange").SpecialCells(xlCellTypeVi sible).Value = "X"
--
Regards,
Tom Ogilvy
"Charley Kyd" wrote in message
...
David,
I'll use SpecialCells(xlCellTypeVisible) to mark the visible area. That's
not the problem. But how do I initialize the entire column--particularly
the
filtered areas? Somehow, I need to ensure that the hidden areas are empty
or have different content than the unhidden areas, so that part of a DSUM
criteria can identify only the visible areas and thus allow additional
criteria to return the sums of subsets of the visible data.
I suppose I could unhide everything, erase the entire column, then
re-establish each filtered column. But that's a lot of work to write and
takes a long time to execute.
The bottom line: How **without looping** can I write data to a range of
cells, some of which are hidden by AutoFilter?
Thanks.
Charley
"David Hager" wrote in message
...
Try:
Range("YourColumnRange").SpecialCells(xlCellTypeVi sible).Value = "X"
--
David Hager
Excel MVP
"Charley Kyd" wrote in message
...
I have a database with many AutoFiltered columns. I'm writing a Sub
that
will put an "X" in all visible cells in a specific column. To do so, I
first
need to erase or mark *all* cells in that record-keeping column so I
then
can mark only the visible cells.
These methods fail:
rngFull.ClearContents
rngFull = ""
rngCell.Copy rngFull
Can anyone suggest a way to erase filtered cells, **without looping**
and
without unhiding the AutoFiltering?
Thanks.
Charley
|