+ Reply to Thread
Results 1 to 3 of 3

Increment data when importing

  1. #1
    Registered User
    Join Date
    06-23-2015
    Location
    Portugal
    MS-Off Ver
    2010
    Posts
    11

    Increment data when importing

    So the code that I have done is working importing a specific range of values and pasting perfectly in the target folder.

    But in my company there exists a need to import the data from that file but to always increment. For example: the file where I extract the data is from week 1 and the info is in the main file but next week the file from week 2 is out and needs to be imported when I import the data it pastes the data over the old one.

    But the problem is that I also need to keep the old data in the main file too. So It should increment down below. to demonstrate this I will use some numbers.

    Data Imported from first week source workbook: 1,1,1,1
    Data pasted In target workbook: 1,1,1,1

    Data Imported from second week source workbook: 2,2,2,2
    Data Pasted in target workbook: 2,2,2,2

    Result wanted data imported from both source WB to target WB: 1,1,1,1,2,2,2,2

    Please Login or Register  to view this content.
    Can you try adding the code in my existing code.
    Last edited by themluis; 06-25-2015 at 09:33 AM.

  2. #2
    Registered User
    Join Date
    06-23-2015
    Location
    Bogota,Colombia
    MS-Off Ver
    2013
    Posts
    4

    Re: Increment data when importing

    Hello,
    I sugest this line:
    targetRow = Application.WorksheetFunction.CountA(Workbooks("TargetWB").Sheets(7).Columns(1).Rows) + 3
    Instead
    targetRow = 3

    It is only to move beyond the last row in the 7 sheet ,

    Use it and let me know if it works!!

  3. #3
    Registered User
    Join Date
    06-23-2015
    Location
    Portugal
    MS-Off Ver
    2010
    Posts
    11

    Re: Increment data when importing

    Works like a charm thanks :D

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Scrollbar increment through data set
    By nanoslee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2014, 06:03 PM
  2. How to Change values by increment in Data Table
    By maani in forum Excel Programming / VBA / Macros
    Replies: 40
    Last Post: 08-25-2009, 07:34 AM
  3. Increment by column from data in rows
    By bs979 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-18-2008, 12:06 PM
  4. Data validation - Cell to increment by 1
    By jimmy mcmahon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-30-2007, 07:30 PM
  5. Increment/Increment letter in alphabetical order
    By Neil Goldwasser in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2006, 05:10 AM

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