+ Reply to Thread
Results 1 to 12 of 12

VB Code to copy certain data

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to copy certain data

    Hello:

    Please refer to attached file.
    I have data in sheet1 as shown.
    I need VB Code to copy certain data from sheet1 to sheet2 at cell A7.
    Start Row is in cell T1 of sheet1 and end row is in cell T2 of sheet2.
    Now need to copy data from sheet1 Column A thru M and Column O thru P to sheet2 in column A thru M and Column O and P starting at Cell A7 of Sheet2.

    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VB Code to copy certain data

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy certain data

    Hi John :

    Works super cool.
    One more favor.
    Need Cell N1 in Sheet2 to be the last row date in Column A of Sheet2.

    Please let me know if you have any questions.
    Thanks.

    Riz

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code to copy certain data

    Hi Riz,

    Here's my code (since I wrote it):

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy certain data

    Hello John and xladept:

    Both codes works great.
    Once again thank you for great help.

    Hey would it be possible to modify the code to highlight the selected cell (Start row and end row) in yellow in sheet1

    Riz
    Last edited by rizmomin; 09-22-2015 at 04:35 PM.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code to copy certain data

    Hi Riz,

    You're welcome and maybe this will justify the rep you've so graciously bestowed

    Please Login or Register  to view this content.
    Maybe:

    Please Login or Register  to view this content.
    Last edited by xladept; 09-22-2015 at 05:11 PM.

  7. #7
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy certain data

    Hi xladept:

    Thanks a lot...will work for me for sure.

    Riz

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code to copy certain data

    Hi Riz,

    You're welcome!

    If you don't want to copy the highlight we can move that line:

    Please Login or Register  to view this content.

  9. #9
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy certain data

    Hi xladept:

    Your code works great.
    I need help to modify the code as below:
    First i do not want the highlighted cell in Sheet2, need just in Sheet1 where the data is copied FROM.
    Second : i want to automate the Start Row# and End Row# in cell T1 and T2 of Sheet1 as follows.
    Please see attached file.
    First time i use, i have highted A3 as start and A13 as end row.
    So code need to use as start Row = 3 and End row as 13
    Now you run the macro.
    Your code will highlight cell A3 and A13.
    Next time i run, Start Row will be A14 (last highlighted row + 1)
    and end row will be the last entered data in column A which in this sample will be 28.

    I hope this is clear and looking forward for your help.
    Please let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code to copy certain data

    Hi Riz,

    If you want the data on sheet2 to be appended, we'll have to rewrite this:

    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy certain data

    Hi xladept:

    Superbbbbbbbbbbbbbbbb..
    Thanks a lot, i feel it is accomplished to my need.
    I will let you know if any further help is needed with this thread.
    Once again thanks

    Riz

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code to copy certain data

    Hi Riz,

    Great!

    You're welcome!

+ 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. VBA code to make of copy of workbook2 and then copy data in that from Workbook1
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2015, 06:34 AM
  2. Replies: 2
    Last Post: 09-08-2014, 07:35 AM
  3. VBA code to copy data from Excel data table to user form
    By Srikanth H N in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2014, 11:53 AM
  4. VBA code to copy paste data in the end of another data
    By Pilot5000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2014, 07:17 AM
  5. [SOLVED] Copy data in different Sheets - vba code
    By missy22 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-05-2012, 12:57 PM
  6. [SOLVED] VBA Code to Save Copy File without Macro Button and VBA Code on Copy?
    By cychua in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-12-2012, 07:23 AM
  7. Code to Copy Data to Every nth Row
    By Winon in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-07-2012, 05:38 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