+ Reply to Thread
Results 1 to 6 of 6

copy data and add a new line (it only does it for 2 rows, after that it overwrites row 2)

  1. #1
    Registered User
    Join Date
    11-22-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    9

    copy data and add a new line (it only does it for 2 rows, after that it overwrites row 2)

    Hi.

    I am trying to make/edit a macro that allows me to copy data from a input sheet "indtastningsark" and send it to the "data" sheet.

    It works with when i push the macro button the first two times, but after that it just overwrites the 2nd line.

    The code is as follows:

    Please Login or Register  to view this content.
    A3 -> V3 works fine (the 22 fields from B7:B28 are covered here)
    A4 -> V4 gets overwritten each time.

    I have uploaded it here

    http://www.sendspace.com/file/b4xm36

    The idea is to send the data from "b7 to b28" to the "data" sheet by pushing the button. It works the first two times, but then it just overwrites the second line.

    Do you have an idea what could be wrong?

    Hope you can help

    Thank you in advance

  2. #2
    Forum Contributor
    Join Date
    08-23-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: copy data and add a new line (it only does it for 2 rows, after that it overwrites row

    Hi,

    Does cell B7 gets blank at third run?

    Coudl you please upload the sample worksheet.
    Last edited by [email protected]; 11-26-2012 at 05:26 AM.

  3. #3
    Registered User
    Join Date
    11-22-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: copy data and add a new line (it only does it for 2 rows, after that it overwrites row

    B7 does not go blank no.

    I have uploaded it here

    http://www.sendspace.com/file/b4xm36

    Is there a other place which is better for uploading or is it fine there?

  4. #4
    Forum Contributor
    Join Date
    08-23-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: copy data and add a new line (it only does it for 2 rows, after that it overwrites row

    Hi,

    In the "Data" sheet, you have formated the first two rows as table. I think thats the issue. Remove the table format of first two rows and macro will run properly.

    Rest code is fine, however I would prefer the below code. Please check the attached sheet.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: copy data and add a new line (it only does it for 2 rows, after that it overwrites row

    Attach a sample workbook.

    When you are in Advanced reply, click on the paperclip to open the upload window.

    View Pic

  6. #6
    Registered User
    Join Date
    11-22-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: copy data and add a new line (it only does it for 2 rows, after that it overwrites row

    Thank you very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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