I know there must be a way to do this but I'm totally new at Excel macros and I don't have much time to figure this out to myself...
I work in a psych lab and we create an Excel file filled with about 50 worksheets for each participant we run through our studies. Usually, we write a macro that can take each participant's file and copy the cells needed in each worksheet to a file formatted in a certain way that we can copy and paste it right into another program. But then we have to find the name of the original file it takes the data from and replace it with the next file we want to deal with. So my first question is, is there a way to make a macro that can do this automatically with multiple files?
Second question: sometimes a cell that we want to copy into the master file is empty. When this happens the macro stops running. Is there a way to tell the macro to just skip over that cell and keep going if it's empty?
Thanks so much for any help you guys can offer me! Below is an example of the really simple type of macro we usually deal with (just imagine that that is one sheet and then it would move on to another sheet in the same file).
Sub Macro1()
Windows("Book1").Activate
Range("A16").Select
Selection.Copy
Windows("Book2").Activate
Range("A16").Select
ActiveSheet.Paste
Windows("Book1").Activate
Range("A19").Select
Selection.Copy
Windows("Book2").Activate
Range("B16").Select
ActiveSheet.Paste
Windows("Book1").Activate
Range("A27").Select
Selection.Copy
Windows("Book2").Activate
Range("C16").Select
ActiveSheet.Paste
End Sub
Bookmarks