+ Reply to Thread
Results 1 to 9 of 9

Newbie - need to copy a row in a sheet until the last row of another sheet

  1. #1
    Registered User
    Join Date
    05-08-2019
    Location
    canada
    MS-Off Ver
    2013
    Posts
    6

    Newbie - need to copy a row in a sheet until the last row of another sheet

    In the attached file, the code is in :
    Sub copie_formules_redressement

    LastRow is last row from sheet "données"

    Within the same sub, I need to copy row 4 from sheet "données_redressées" down to the last row "LastRow".

    Feel free to help but please keep in mind I am a newbie with VBA...

    Thanks !

  2. #2
    Registered User
    Join Date
    05-08-2019
    Location
    canada
    MS-Off Ver
    2013
    Posts
    6

    Re: Newbie - need to copy a row in a sheet until the last row of another sheet

    sorry here is the file
    Attached Files Attached Files

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Newbie - need to copy a row in a sheet until the last row of another sheet

    Hi and welcome to the forum

    There was nothing attached.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    05-08-2019
    Location
    canada
    MS-Off Ver
    2013
    Posts
    6

    Re: Newbie - need to copy a row in a sheet until the last row of another sheet

    Thanks it is now attached sorry

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Newbie - need to copy a row in a sheet until the last row of another sheet

    Sorry but it's not clear (at least to me) what you expect to see as the result.

    Would you add another sheet which shows what the results should look like?

    Incidentally, rather than zip the workbook just upload it directly - it saves us having to unzip it.

    I'm also interested to understand what task you are trying to accomplish with the system. The 'donnees' sheet seems quote complex and a rather strange way of keeping a database

  6. #6
    Registered User
    Join Date
    05-08-2019
    Location
    canada
    MS-Off Ver
    2013
    Posts
    6

    Re: Newbie - need to copy a row in a sheet until the last row of another sheet

    Thank you for your reply, and sorry if it is not clear.

    I've uploaded a smaller file, with less rows (I've kept 10 only in tab 'données')

    The code should go in tab 'données' and find the lastrow, in variable LastRow.
    Then it should go in tab 'données_redressées' and copy the formulas that are in row 4 down to LastRow (in this case row 10).
    The formulas in row 4 should be are already there in the file.

    Yes, the database is quite strange, and we will get rid of this at the end of 2019 for another better database.
    Attached Files Attached Files

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Newbie - need to copy a row in a sheet until the last row of another sheet

    Still somewhat puzzled

    1. Are you building up a cumulative set of data in donnees redressees by copying whatever is in donnees to the bottom of donnees redressees?

    2. The donnees redressees formulae are linked directly to their equivalent in the donnees sheet so that the two sheets are EXACTLY the same. Therefore why not just have a single sheet and add any new data to that sheet. Why do you need two sheets the same?

  8. #8
    Registered User
    Join Date
    05-08-2019
    Location
    canada
    MS-Off Ver
    2013
    Posts
    6

    Re: Newbie - need to copy a row in a sheet until the last row of another sheet

    Thank you again...

    No, not cumulative, and all lines in 'données' should be found in 'données_redressées'.
    When I paste new data in 'données' and run the macro again, new lines should be found in 'données_redressées'.

    Yes, the data in 'données_redressées' will mostly be the same than in 'données', but if you look carefully, there are some vlookups that search in tab 'Dossiers Événements' to show different data. Those columns are in orange.

    So roughly, the code should find the number of lines with data in 'données' and then go in données_redressées in order to copy the formulas in row 4 until the last row with data.

  9. #9
    Registered User
    Join Date
    05-08-2019
    Location
    canada
    MS-Off Ver
    2013
    Posts
    6

    Re: Newbie - need to copy a row in a sheet until the last row of another sheet

    In fact, each time I need to update this file, all the previous data is deleted and new data is pasted in 'données'.

+ 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. Please help this Newbie.....Copy entire row into a new sheet based on cell data
    By mdenny73 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-02-2015, 08:17 AM
  2. VBA newbie - copy range/rows from sheet into different workbook
    By luke1908 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-29-2013, 06:20 AM
  3. Lookup Value from Sheet 4 in Sheet 2, if found copy Sheet 2 Active Row to Sheet 5
    By lgosso23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2013, 02:51 PM
  4. Replies: 1
    Last Post: 06-06-2013, 02:28 PM
  5. Replies: 3
    Last Post: 04-23-2013, 06:49 PM
  6. Replies: 11
    Last Post: 10-14-2012, 01:03 PM
  7. Taking a cell from sheet 2 to sheet 1 (newbie here)
    By ChipCarlton in forum Excel General
    Replies: 5
    Last Post: 10-13-2005, 12:26 PM

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