Forum Discussion
serge625
Feb 24, 2019Copper Contributor
Need help to build Excell macro
Dear all,
I have a sample excell Sheet 1 in wich I have a bunch of data collected by an aquisition system. The date a represented as :
In A column: date and time of the sample
In B column value of the sample
I have 1000 records displays. The goal is that within this 1000 records, I need to display in Sheet 2 :
- Column A the date and time of sample at T0+60second of Shhet 1
- Column B the Value of sample at T0+60second of Shhet 1
In other words from the whole set of the 1000 records wich I have collected I need to extract one record every 60s
How cqn I do that with a macor, never doen this before and never use but if you provide sample I could understand
Thanks for help
regards
- DeletedWould be easier to use PowerQuery and then no code would be needed.
Convert data to a table, select data then from Insert tab select Table.
Place cursor in table and go to Data tab, then select get data from table.
When the query editor opens filter you column by 60 sec intervals, then click close and load.
And it will return data into a new tab with what you want.- serge625Copper Contributor
Thnaks for your reply.
Will I have to be able to repeat that steps for all my sample each time ?
the final approach is that :
- I have an acquisition system which run for 30mn and collect a big bunch of data
- For this acquisition set I need to extract every 30s sample measure
Then I need to run the same process for an other set of 30mn acquisition and need to extract the same thing.
At the end I can compare each extracted values for each acquisition set.
I was thinking of using MACRO because the same operation will be done many time.
Does your approach with Power Querry run in similar , meaning that as soon it is created once I can apply it for other set of data without recreating it ?
regards
- DeletedIts possible by using parameters, and passing the table name to the query.
Using Excel to do this seem like the wrong tool. I personally would fire this into a database and then you could manipulate in a multitude of ways to achieve the above requirements repeatedly and consistently without manual intervention ...