+ Reply to Thread
Results 1 to 6 of 6

Need defined parameters on macro that combines workbooks

  1. #1
    Registered User
    Join Date
    08-19-2010
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    97

    Need defined parameters on macro that combines workbooks

    I have this macro that combines a series of workbooks in a filepath I tell it to look it. The problem with the macro is that when it pastes all the workbooks into the raw data workbook it erases all information below row one. I would like to adjust the macro so that it just copies and pastes into the column range I define, in other words, copy columns A:BJ, rows 7:till it finds no data in column A

    here is the code:
    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Need defined parameters on macro that combines workbooks

    It doesn't look like it deletes anything from the 'source' files. Is the problem that it clears the target sheet (Sheets("Raw Data")) prior to importing the new data?

    If so, just delete or comment out the line wsDest.UsedRange.Offset(1).Clear.

    Dion

  3. #3
    Registered User
    Join Date
    08-19-2010
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Need defined parameters on macro that combines workbooks

    the problem isn't necessarily that it clears, it's the range that it clears which is everything below row 1, i still need it to clear everything below row row but only in between columns A:BJ and I'm not figuring out how to set that range.

  4. #4
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Need defined parameters on macro that combines workbooks

    Replace

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-19-2010
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Need defined parameters on macro that combines workbooks

    still seems to be clearing column BK and I'd fix it myself but I totally don't understand this particular code. I get so lost when it's not clear cut rows and columns.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Need defined parameters on macro that combines workbooks

    hi, juniperjacobs, please attach couple of files to test your code and please clearly define result you need to obtain on the basis of those two files

    Or try to change this:

    Please Login or Register  to view this content.
    to this

    Please Login or Register  to view this content.
    Last edited by watersev; 05-20-2011 at 04:28 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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