Consulting

Results 1 to 3 of 3

Thread: Simple Sheet copy problem: Workbook to Workbook

  1. #1
    VBAX Newbie
    Joined
    Dec 2010
    Posts
    2
    Location

    Simple Sheet copy problem: Workbook to Workbook

    I have the following problem (this is a work-around for something else
    so it may not make much sense):


    From Workbook A copy sheets 1 and 8 to Workbook C
    From Workbook B copy sheets 2,3,4,5,6,7 to Workbook C

    Also I'm not sure of where this VBA should run
    for the simplest coding; from A, B or C?

    cheers, Pete

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    From anywhere

    [VBA]

    With Workbooks("C.xls")

    Workbooks("A.xls").Worksheets("Sheet1").Copy After:=.Worksheets(.Worksheets.Count)
    Workbooks("A.xls").Worksheets("Sheet8").Copy After:=.Worksheets(.Worksheets.Count)
    Workbooks("B.xls").Worksheets("Sheet2").Copy After:=.Worksheets(.Worksheets.Count)
    Workbooks("B.xls").Worksheets("Sheet3").Copy After:=.Worksheets(.Worksheets.Count)
    Workbooks("B.xls").Worksheets("Sheet4").Copy After:=.Worksheets(.Worksheets.Count)
    Workbooks("B.xls").Worksheets("Sheet5").Copy After:=.Worksheets(.Worksheets.Count)
    Workbooks("B.xls").Worksheets("Sheet6").Copy After:=.Worksheets(.Worksheets.Count)
    Workbooks("B.xls").Worksheets("Sheet7").Copy After:=.Worksheets(.Worksheets.Count)
    End With
    [/VBA]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Dec 2010
    Posts
    2
    Location
    wow! Thanks a lot. So it is a pretty simple problem!

    Thanks again,

    Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •