I have two workbooks that reference one another in which the cells are equal to each other.
These are the workbook names:
Baseline.xls
Database.xls
If I use the filter on the Baseline workbook, it still automatically fills the Database workbook with all of the cells. I would like for the Database workbook to only grab the visible cells from the Baseline workbook when I filter the Baseline. Is this possible?
Here is the code I am working with:
Sub FillDate() Windows("Baseline.xls").Activate Dim Rng As Long, Rng1 As Range Rng = Sheets("Current").Range("BJ" & Rows.Count).End(xlUp).Row Windows("Database.xls").Activate Range("A4").FormulaR1C1 = "='[Baseline.xls]Current'!R[7]C[61]" With Sheets("Replacement") .Range("A4:A" & Rng).FillDown End With End Sub
Yor code is simply adding formulas to the sheet that read the data. You could use code to copy the filtered data in one go to the target workbook
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
I don't want to use a copy and paste method because the data may change and if the cells are equal then that allows the data to change on the Database workbook as well.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks