![]() I suppose what I need to implement into this is to declare the target workbook as a variable. Workbooks.Open filename:="source.xlsx", _ This is what I have right now: Sub CopyData() Searching the site, I could only find solutions that specified the path for both workbooks. The source workbook will always have the same path though. This is a process that is going to need to be ran multiple times with different target workbooks, so the VBA code can't refer to a workbook filename for the target. So either I need to find a way to paste the data with the conditional formatting, or I need to be able to switch back to the target workbook before closing the source workbook. The problem is that the source workbook contains conditional formatting, and if the source workbook is closed before you paste into the target workbook, the conditional formatting isn't being pasted. Paste into worksheet titled "Temp" in target workbook.The most success I've had is recording the macro and make this happen: ![]() I want to be able to have a workbook open, run a VBA script to open another workbook, copy a range from it, then paste that to the original workbook. I've figured out most of this myself, but the part that is hanging me up is being able to paste the conditional formatting.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |