+ Reply to Thread
Results 1 to 5 of 5

Select a cell in a reset macro

  1. #1
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Select a cell in a reset macro

    Hi All,

    I have a Reset Macro here and i am having some trouble with selecting a cell within the macro. If you look at the code i have written a statement on line 22 of something i would like to do. I would like to be clearing the contents of this sheet and right before i clear the contents in cells C37:C56 i would like to select the cell C56. The reason i am doing this is because there is code on that page that conditionally locks cells C37:C55. when i run it right now, since some of the cells in C37:C56 are locked it comes with an error saying it cannot delete things in locked cells. So in order to unlock the cells in the sheet one must delete all of the contents that are the condition on the lock and then for some reason select cell C56. I am hoping that with this order the macro will be able to run the sheets code while runnning the macro and the sheet will be unlocked so that the macro can continue to run. I know this should be something simple but i am a VBA newbie, got most of this code from recording a macro to delete all of the user inputed data. Thanks for any help.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Select a cell in a reset macro

    amotto11,

    You can't select a range unless the worksheet is the active worksheet. so you'd need:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Select a cell in a reset macro

    Quote Originally Posted by tigeravatar View Post
    amotto11,

    You can't select a range unless the worksheet is the active worksheet. so you'd need:
    Please Login or Register  to view this content.
    Okay, That worked. Except now my screen is updating for some reason. I do not want it to update. Any suggestions?

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Select a cell in a reset macro

    You could have that worksheet to be the last worksheet that gets reset, and subsequently, the .select and .range.select lines will be basically at the end of the macro. Aside from that, it's weird that the screen updates at all until after the macro turns screenupdating back on.

  5. #5
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Select a cell in a reset macro

    I have to leave it this way, because of other code on other pages. Do you or anyone else know what could be causing my screen to update prematurely?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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