+ Reply to Thread
Results 1 to 5 of 5

Inefficient 'select sheets' macro - needs improving pls!

  1. #1
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 2016
    Posts
    260

    Inefficient 'select sheets' macro - needs improving pls!

    I have the following code which iterates through about 1000 worksheets, each time selecting the sheet, copying the value of cell BC88 and then pasting this value in to a different cell on sheet PCC_SUMMARY (but also always selecting worksheet PCC_SUMMARY as well). I realise this is inefficent since it has to select the sheets all the time and there is a way to just copy/paste the data without selecting sheets. It probably makes use of the with.sheet command but I have tried variations and cannot get it to work!

    Would greatly appreciate it if someone can amend the code or give me some pointers as it is making my macro run very slowly at the moment....

    Thanks
    -Rob

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Inefficient 'select sheets' macro - needs improving pls!

    Hi Rob,

    please try the following - since you didn't include a sample workbook I couldn't test it, but it should work

    Please Login or Register  to view this content.
    Please click the * below if this helps
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    01-28-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003, Excel 2007, Excel 2010
    Posts
    50

    Re: Inefficient 'select sheets' macro - needs improving pls!

    This should make it a bit faster, and also prevents the macro from reading cell BC88 on the PCC_SUMMARY sheet.
    If you still want it to read from that sheet then remove the if and if end lines

    Please Login or Register  to view this content.
    Edit - Ah, beaten to it
    Last edited by bodhi808; 09-13-2013 at 06:25 AM.
    Please consider the * button if my post helped you

  4. #4
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 2016
    Posts
    260

    Re: Inefficient 'select sheets' macro - needs improving pls!

    Both of those work, thanks guys, +1 rep to both of you.

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Inefficient 'select sheets' macro - needs improving pls!

    Rob.

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ 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. improving code by removing select
    By Zealotwraith in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2013, 04:13 PM
  2. Creating a macro to print only the sheets and portion of sheets that i select.
    By cadamhill in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-31-2012, 01:48 PM
  3. [SOLVED] Optimize a large inefficient macro
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2011, 09:11 AM
  4. inefficient sheets
    By Fateyes in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 07-18-2007, 12:10 PM
  5. Inefficient macro won't complete
    By Fox via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2006, 03:45 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