I am having trouble with what I thought was a simple bit of code to copy a range from one workbook to another. Both are assumed open at the time, but will change in name frequently so are set up (or attempt to set up) as names defined at top. The full macro will work on multiple ranges and sheets, but I have just posted core/repetitive code here.
I get Compile error Type mismatch at first hurdle (Set wb1 = ...); not clear what errors I may get on remainder.
Dim wb1 As Workbook Dim wb2 As Workbook Dim ws1 As Worksheet Dim ws2 As Worksheet Set wb1 = ("2017.07.09 xxx yyy zzz v18.xlsm") Set wb2 = ("2017.07.09 results output.xlsm") Set ws1 = Worksheets("Output Results Sheet") Set ws2 = Worksheets("CityName") wb1.ws1.Range("O8:P13").Copy wb2.ws2.Range("N5:O10")