Forum Discussion
need help with importing complex csv, sorting it, then adding to table
dsj7419 Can't replicate the issue or just don't understand. When I run your macro it imports garbage on many rows. PQ, on the other hand, gives me what seems to be a clean table with 107 rows. All nicely lined-up and long comments with with commas in them are returned in one single cell on the correct row. See example in the picture below:
- Riny_van_EekelenMay 29, 2023Platinum Contributor
dsj7419 Why is the 'survtbl' important? Your formulas contain direct references to cells in the Survey sheet that go beyond the bounds of the table range. So you are not using structured table references.
Anyway, see if the attached file works for you. It points to the CSV on your system and should work right away.
I picked the columns that you seem to be wanting with PQ and loaded them into a set of pivot tables producing the statistics close to yours. Can't tell why they are not matching, as I didn't look into your formulas in detail. With Power Pivot you can probably do it all in one pivot table, but I didn't go so far.
The message I want to convey is that PQ and a few pivot tables (or one Power Pivot) can probably do what you need without the need of VBA and rather complicated formulas.
- dsj7419May 29, 2023Copper ContributorThanks Riny,
Unfortunately this is not the scope I was looking for. I need to do as requested. The data from the CSV needs to be imported and replaced with the data from survtbl (or added to, removing duplicates). connecting like you did is fine and it works, but doesnt do what I need it to do as its not just me using it. we need to to visually sort and import so it takes advantage of the conditional formatting and looks the same.
Maybe someone else can assist here? maybe this isnt doable?
my next plan was to move to python, but I really dont want to do that as again other people need to use it which is why I was opting for a VBA button to keep it easy.