+ Reply to Thread
Results 1 to 5 of 5

Adding Checkboxes, But Macro still takes too long to execute

  1. #1
    Forum Contributor
    Join Date
    09-13-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    111

    Adding Checkboxes, But Macro still takes too long to execute

    Good Morning All,

    I have a macro that adds checkboxes to an excel worksheet. The problem is, it takes too long to load. When you run it, I see each individual checkbox being created. I figured this happens because the worksheet is activated. But, I have to activate the worksheet to add the checkbox.

    Is there a way, or a method, of adding checkboxes without activating the worksheet? This way my "Application.ScreenUpdating = False" statement will apply.

    Below is what my code looks like. thanks!

    Please Login or Register  to view this content.
    I'm going to try hiding the sheet and see if that works.

    It's pretty straighforward.

    Thanks for the help everyone!
    Bob1980

  2. #2
    Forum Contributor
    Join Date
    09-13-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    111

    Re: Adding Checkboxes, But Macro still takes too long to execute

    Okay, that was a quick one! Hiding the sheet worked. I used the xlSheetVisible property so that the worksheet can still be manipulated. Below is an update to anyone who visits this thread.

    Please Login or Register  to view this content.
    thanks all.

    Bob1980

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Adding Checkboxes, But Macro still takes too long to execute

    You could also eliminate the .Select which is time expensive.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Adding Checkboxes, But Macro still takes too long to execute

    or
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-13-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    111

    Re: Adding Checkboxes, But Macro still takes too long to execute

    Oh I like both. I'll remove the .selection and use 7 & 8 as opposed to adding the FOR i value. I'll save time with both!

    Thanks!
    Bob1980

+ 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. Inefficient code - macro takes too long
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-07-2014, 09:29 AM
  2. VBA takes too long to execute..
    By ruchi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2009, 04:53 AM
  3. My Code takes too long to execute
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2008, 12:12 AM
  4. how do i add time to see how long my macro takes to run
    By ernestgoh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2006, 06:10 AM
  5. Counting how long a Macro takes to run
    By Diane Alsing in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2005, 02:06 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