VBA code to Fill Down in a filtered list only to visible cells.

T

Training Goddess

I have a list that I need to filter so that when I create a formula and fill
down to the bottom of the list it will only fill the visible cells. I can do
this when I create the formula normally, but the recorded version of VBA code
doesn't work. Essentially, I am looking to fill down a formula to only the
visible rows/cells in column within a list. Any ideas?

Thanks in advance!
Training Goddess
 
S

SeanC UK

Hi,

I'm not sure how you're currently filling down the cells, but using
SpecialCells(xlCellTypeVisible) for a range should work out.

For instance, I could write it like this:

Set rng = sht.Range(Cells(2, 3), _
Cells(10, 3)).SpecialCells(xlCellTypeVisible)
rng.Value = "yeeble"

Just replace "yeeble" with your formula, and obviously replace the range to
suit.

I hope this helps,

Sean.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top