+ Reply to Thread
Results 1 to 5 of 5

Keep sheets based on color and copy paste as values. Delete the remaining ones

  1. #1
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Keep sheets based on color and copy paste as values. Delete the remaining ones

    I have the following macro that should keep the tabs that have a specific color, turn them to values and delete all the other. The color part works in another macro that I use to PDF the sheets but not here. The second For works as well. But put together, the workbook freezes and nothing happens. Can someone point me in a direction about it?
    Please Login or Register  to view this content.
    Click the * to say thanks.

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Keep sheets based on color and copy paste as values. Delete the remaining ones

    wsColor(0) is never set so will probably equal zero which won't match any sheets. Perhaps you need somewhere:

    Please Login or Register  to view this content.
    Probably after the line that sets wsNames(0).

    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Keep sheets based on color and copy paste as values. Delete the remaining ones

    Oh, I cleaned the macro and removed that line by mistake. I already have it my actual file set, but unfortunately it still not works.

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Keep sheets based on color and copy paste as values. Delete the remaining ones

    Can you redact the data and attach a copy of the file? Would probably be trivial to diagnose then but almost impossible without having a copy of the file.

    WBD

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Keep sheets based on color and copy paste as values. Delete the remaining ones

    In case someone will find this thread, here is a solution. Not sure why I overcomplicated the problem.
    Please Login or Register  to view this content.

+ 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. [SOLVED] Copy & Paste Cell Values based on conditions to separate sheets from primary sheet
    By spyac in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-05-2018, 08:04 PM
  2. [SOLVED] Create new sheets and copy/paste data based on values in a column or columns
    By quintans1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2015, 12:15 PM
  3. Replies: 1
    Last Post: 10-05-2014, 12:28 PM
  4. Compare two sheets,copy and paste unique rows based on values in 2 columns
    By ooggiemobile in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2013, 03:58 AM
  5. [SOLVED] Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2005, 08:12 PM
  6. Replies: 0
    Last Post: 06-21-2005, 01:05 PM
  7. [SOLVED] Re: Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2005, 01:05 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