Results 1 to 2 of 2

Copying and pasting a dynamic range

Threaded View

  1. #1
    Registered User
    Join Date
    05-27-2015
    Location
    KL
    MS-Off Ver
    2007
    Posts
    1

    Copying and pasting a dynamic range

    Hope you guys can help me out with this

    Background:
    I am trying to build an activity manager for my sales team. Each one of them will hold a standardize template in which then they will update their appointments and then saved into a general folder. I then want to consolidate my entire team's activities into one sheet so that I have the master view

    Where I am:
    I am able to write a script that opens all files, copies and pastes perfectly. However this is where the problem starts. I am unable to write a script that identifies the range to copy (row and column). Currently all I have is a static range

    Case in point: (this is a sample of what a sales person would fill in on the daily
    Sales.jpg
    With each passing day, the list will grow longer downwards

    And I want to consolidate all my files, so the consolidated view looks something like this
    Conso.jpg

    Can someone help me out with my script?

    It is as such

    -------------------------------------------------------------------

    Sub ActivityManager()
    Dim MyFile As String
    Dim erow
    Dim Filepath As String
    Filepath = "C:\Pipeline Manager\"
    MyFile = Dir(Filepath)

    Do While Len(MyFile) > 0
    If MyFile = "zConsolidation.xlsm" Then
    Exit Sub
    End If

    Workbooks.Open (Filepath & MyFile)
    Range("A2:G6").Copy
    ActiveWorkbook.Close

    erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range(Cells(erow, 1), Cells(erow, 7))

    MyFile = Dir
    Loop

    -------------------------------------------------------------------

    I believe the only remaining parts are in the ones highlighted in red. Help please?

    Thank you

    Best regards
    Wengie
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copying and pasting Named (Dynamic) Ranges from one workbook to the other
    By Let in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2012, 10:06 AM
  2. Copying and Copy and Pasting Formula with Dynamic number of rows
    By patelh9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2010, 11:33 PM
  3. copying and pasting a dynamic range
    By mashoutposse in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2010, 06:16 PM
  4. Copying + pasting special a dynamic range of cells through a macro
    By kostas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2007, 07:20 AM
  5. Dynamic copying & pasting of rows
    By Chris Bromley in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-08-2005, 12:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1