Excel - copy excel filtered cells
Show older comments
I have a set of data (several rows and several columns) in one excel spreadsheet. It's possible to apply filter on some columns and as a result some rows become hidden.
I would like to copy the visible cells only but when I select some rows using "Range" matlab gets every rows existing inside the defined range, the visible ones and the hidden one.
Is there a way to select the visible cells only ? Or do you have any idea to go around it ?
Thanks a lot!
3 Comments
Bob Thompson
on 9 Jan 2020
What kind of filtering are you using? Can you not just filter the results in the imported Matlab information?
The reason the import doesn't work this way is because Excel doesn't technically get rid of the information between, it just hides the filtered rows. You could edit your range to include the specific rows, but most likely that will be more effort than it's worth. You can also try copy and pasting the visible excel information into a matrix in matlab, but any mixed information will make this difficult.
Lucas SCHUBER
on 9 Jan 2020
Bob Thompson
on 9 Jan 2020
It might be possible to identify the visibility flag using the ActX server, but doing so would force you to probably rewrite your entire interction with Excel. I suggest sticking with the macro you have written now, unless there are more specific issues of why you don't like that method.
Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!