Consulting

Results 1 to 3 of 3

Thread: get data macro

  1. #1
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location

    get data macro

    Hi

    Need help with a macro that will copy and paste all data from one workbook "Monthly Income Report"

    data range: row 1 col A (start) to col N for all row down say to 500.

    and paste this into a second workbook "RevalComparisonModel"

    data range: row 5 col A (start) to col N (all the way down in rows to match data from first workbook). - macro button to be placed in second workbook.

    the number of columns remains fixed cannot change always A to N......and the start of each row has to be:

    row 1 - firstworkbook and row 5 second workbook.

    thanks.......for all your help/feedback developers.....

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

    Const TARGET_WB As String = "Book3"
    Dim iLastRow As Long

    With ActiveSheet
    iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
    .Range("A1").Resize(iLastRow, 14).Copy Workbooks(TARGET_WB).Worksheets(1).Range("A5")
    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 Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    Thanks for the feedback

Posting Permissions

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