Results 1 to 1 of 1
  1. #1
    New Lounger
    Join Date
    May 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy go excel with bookmarks to copy rows from a book1 and paste it in colums

    Hi,
    I have a little problem...

    I need to make a loop to go every rows and colums with values from my book1 and copyAndPaste to my book2, i have all code made but is not automatically, i'm new with visual basic and i don´t understand how is going


    My code is:

    Sub CopyAndPaste()


    '
    '
    'First i copy dates from my file 1 to my file 2 (loop ok)
    '

    Range("A1").Select

    Do While ActiveCell <> Empty

    ActiveCell.Offset(1, 0).Select

    Loop


    Windows("Database003b.xlsx").Activate
    Range("B1:AF1").Select
    Selection.Copy
    Windows("template-ChartDataQ.xlsx").Activate

    Range("E1428").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=True

    '
    'Here copy other values, but is not automatly
    '
    Windows("Database003b.xlsx").Activate
    Range("A48").Select
    Selection.Copy
    Windows("template-ChartDataQ.xlsx").Activate
    Range("C1428").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Selection.AutoFill Destination:=Range("C1428:C1458")
    Range("C1428:C1458").Select


    '
    'Here copy other values, but is not automatly
    '
    Windows("Database003b.xlsx").Activate
    Range("B48:AF48").Select
    Selection.Copy
    Windows("template-ChartDataQ.xlsx").Activate
    Range("F1428").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=True


    '
    'Here copy other values, but is not automatly
    '
    Windows("Database003b.xlsx").Activate
    Range("AG48").Select
    Selection.Copy
    Windows("template-ChartDataQ.xlsx").Activate
    Range("A1428").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Selection.AutoFill Destination:=Range("A1428:A1458")
    Range("A1428:A1458").Select

    '
    '
    '


    '
    'And finally i put the mouse into my last active cell

    Range("A1").Select

    Do While ActiveCell <> Empty

    ActiveCell.Offset(1, 0).Select

    Loop


    End Sub
    Last edited by cucuyito; 2013-06-10 at 08:51.

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

Tags for this Thread

Posting Permissions

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