ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA code to Fill Down in a filtered list only to visible cells. (https://www.excelbanter.com/excel-programming/423775-vba-code-fill-down-filtered-list-only-visible-cells.html)

Training Goddess

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

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

SeanC UK[_2_]

VBA code to Fill Down in a filtered list only to visible cells.
 
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.



--
(please remember to click yes if replies you receive are helpful to you)


"Training Goddess" wrote:


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



All times are GMT +1. The time now is 12:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com