View Single Post
  #25   Report Post  
Posted to microsoft.public.excel.misc
Terry Pinnell[_4_] Terry Pinnell[_4_] is offline
external usenet poster
 
Posts: 192
Default Activate a workbook?

Claus Busch wrote:

Hi Terry,

Am Wed, 08 Mar 2017 13:54:38 +0000 schrieb Terry Pinnell:

If a run that code I get the familiar 'Subscript out of range' error on
this:
Set wshS = ThisWorkbook.Sheets("Track Data")


then change the reference to:

Set wshS = Workbooks("TEST track sheet copying.xlsm").Sheets("Track Data")
Set wshD = ThisWorkbook.Sheets("TEMP")


Regards
Claus B.


Hi Claus,

Thanks. Although that now ran without error, as you see from my
screenshot, B10 was not copied to J2. I tried editing
strS = "B3,B4,B5,B11,B12,B13"
to
strS = "B3,B4,B5,B10,B11,B12,B13"
but that gave a subscript out of range error on this line
..Range(varD(i)) = wshS.Range(varS(i))
which is further up the re-learning curve than I've reached ;-)

Layout:
https://dl.dropboxusercontent.com/u/...Copying-08.jpg

I'm about to try your later code.

Best wishes,

Terry, East Grinstead, UK
Thursday 9 March 2017, 0834