+ Reply to Thread
Results 1 to 14 of 14

VB Code Copy and Paste in different sheet

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

    VB Code Copy and Paste in different sheet

    Hello:

    Please refer to attached file.
    Shee1 has data.
    I need a VB Code to do the following.
    Need to check if any cell in column B are highlighted.
    If any cell is highligted then i need data from that row column L thru T and copy that data in
    Sheet3 at Cell B2.
    If more then 1 cell is highlighted then do the same again at the next availble cell in coulm B Sheet3

    Let me know if you have any questions.
    Thanks.
    RM
    Attached Files Attached Files

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code Copy and Paste in different sheet

    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 Copy and Paste in different sheet

    Hi Karedog:

    Superb,.....Thanks a lot.
    Works great

    Riz

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code Copy and Paste in different sheet

    You are welcome Riz, thanks to you too.


    Regards

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

    Re: VB Code Copy and Paste in different sheet

    hi karedog:

    Sorry to bother you but when i tried to the code in my actual sheet it gives error.
    I have hidden data isn Column B as it consist of SS#
    Refer to attached pic which shows you how my data is and not sure if the filter will work with this.
    Please help.
    Thanks
    Riz
    Attached Images Attached Images
    Last edited by rizmomin; 10-08-2015 at 09:34 PM.

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code Copy and Paste in different sheet

    Please try this :

    Please Login or Register  to view this content.
    If this is not worked as expected, you need to upload your workbook.

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

    Re: VB Code Copy and Paste in different sheet

    Hello karedog:

    I have tried both codes and still would not work.
    Please refer to attached file.

    Let me know if you have any questions.
    Thanks.
    RM
    Attached Files Attached Files

  8. #8
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code Copy and Paste in different sheet

    Hi Riz,

    You use differect cell background color (although they both are green, but not the same color).
    I have modified the code to apply the new color, also change it to use listobject.

    Please Login or Register  to view this content.
    You can see the code use different RGB value :
    in first code (in post #2) : RGB(153, 204, 0)
    in second code (in this post) : RGB(146, 208, 80)

    In case you will use some other color in the future, and you want to know the RGB value of the cell background color, you can use this code :
    Please Login or Register  to view this content.
    First, click the cell which its background color is to be retrieved, and then run the RGB_Of_ActiveCell sub.

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

    Re: VB Code Copy and Paste in different sheet

    Hi Karedog:

    Above code seems to work except small issue.
    Need to copy column L to T data at B2 of Sheet3.
    Also would be nice to have 1 in column A of Shee3.
    Please let me know if you have any questions.
    Thanks.

    RM

  10. #10
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code Copy and Paste in different sheet

    Do you mean adding increment numbers in column A ?

    Maybe :
    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 Copy and Paste in different sheet

    Hi karedog:

    Seems to work superb except in sheet3, column A needs to be 1 instead of increment.
    Please modify and Please let me know if you have any questions.
    Thanks.
    RM

  12. #12
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code Copy and Paste in different sheet

    This should do :

    Please Login or Register  to view this content.

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

    Re: VB Code Copy and Paste in different sheet

    Hi karedog:

    Cool...works great.
    Thanks a lot
    RM

  14. #14
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code Copy and Paste in different sheet

    You are welcome, glad I can help.


    Regards

+ 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 Copy entire sheet and paste in another sheet
    By molly13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2015, 11:45 AM
  2. [SOLVED] Copy and Paste in active sheet VBA code
    By raw_geek in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2014, 04:43 AM
  3. VBA code to search from different sheet > Copy the row > Paste on different sheet.
    By qpywsqp in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-26-2013, 11:13 AM
  4. [SOLVED] VBA code to copy and paste an entire row from one sheet to another
    By emach in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-24-2013, 12:12 PM
  5. Replies: 1
    Last Post: 03-28-2013, 02:49 PM
  6. Sheet code to copy & paste a new row of Info to another sheet
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-23-2012, 05:31 PM
  7. Add sheet. Copy Code & Paste in new Module
    By omnibuster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2008, 03:37 AM

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