Hello, I'm very new to using macros and also very new to this forum! I wondered if anyone could help me with a VBA macro that I'm a bit stuck with. I work as a researcher and I'm collecting data from an eye tracker, this generates a few thousand lines of code per person as I get a row of data every 16ms. As a result, I'd like to summarise the data into something that's slightly more manageable!
I've been trying to adapt a macro written for a similar experiment but I'm pretty stuck as I can't see what's going wrong. The task involves people looking at images (six possibilities) and hearing a sentence. I have a workbook with a worksheet in that contains the words that are heard and the onset and offset times of each of the words. For each word that is heard in each sentence I want the macro to sum the amount of time spent looking at each area of interest (AOI) and print this with the following headings.
Phrase= sentence heard
Word_Playing= word playing from sentence
Time_in_AOI= time spent looking at target AOI.
AOI1_Pic= name of the picture at AOI1
AOI1_Time= time spent looking at AOI1
...
...
...
..
AOI6_Pic=name of the picture at AOI1
AOI6_Time=time spent looking at AOI1
Time_Not_Looking= time spent not looking
As the code stands it runs and generate a new worksheet and the headings but that's about all. I keep getting a runtime 91 error, debugging says that this:
is the problem. Being so new to macros I'm not sure what this is line is achieving. This error ties in with the macro failing to find the AOI worksheet (a textbox appears stating this), I'm not sure why.![]()
Please Login or Register to view this content.
I've attached my workbook and also my code (I've tried to comment as much as I could work out) as I think this might be helpful, I couldn't embed my code as it made this post too long.
Does anyone have any idea how I might fix this as I'm a bit stuck and any help would be very gratefully received ? I'm keen to learn about macros but my Googling of the problems to date haven't been to helpful.
Thank you,
Kerry
Bookmarks