A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Are you sure that is the highlighted line? From the error message that you reported I'd expect it to be one of the lines below that...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi.
I have a series of identical workbooks in a folder in the following location: C:\Users\hughesel\Desktop\Test
I want to create a macro which will open each of the files in turn and select all of the contents on the QPI sheet and paste special values the information (to remove the fomulas. The QPI sheet is password protected so that would need to be turned off too
I then want the file to be saved and closed before the macro moves on to the next file in the folder.
I have tried to peice together bits of code myself but with no success.
Is anyone able to help?
Many thanks.
Kind Regards.
Liz.
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Are you sure that is the highlighted line? From the error message that you reported I'd expect it to be one of the lines below that...
Hi.
The line that is highlighted is:
Set wbk = Workbooks.Open(strPath & strFile)
It opens the first workbook in the folder but then doesnt perform the actions on it.
Liz.
When the error occurs, click Debug in the error message dialog.
This will take you to the Visual Basic Editor with the offending line highlighted in yellow.
Which line is that?
(You can click the Reset button on the toolbar or select Run > Reset to end the macro)
Hi.
Thanks for your help - this initially didnt work, but then started to work and now is not working again.
When I get an error it is a 1004 one which i dont know how to fix - any ideas? It says select method of worksheet class failed.
Kind Regards.
Liz.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more