+ Reply to Thread
Results 1 to 4 of 4

code for selecting cell A1 on activate worksheet.

  1. #1
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    code for selecting cell A1 on activate worksheet.

    Dear All - good evening. Does anyone have any code which will do the above? I have a workbook with around 30 worksheets (i know i know)!! its what the user wanted............! I would like that whenever someone enters a sheet that cell a1 is selected or that the sheet returns to the home position upon activation.

    so far ive been messing around with the below, dont laugh!

    ActiveSheet.Range("A1").Select

    Sub Macro1()
    '
    ' Macro1 Macro
    '

    '
    Sheets("Communications").Select
    Range("A1").Select
    End Sub

    Sub MakeActive()
    Worksheets("Website Usage1").Activate
    Range("A1").Select
    Range("A1").Activate
    End Sub

    Private Sub Workbook_Open()
    Worksheets("Home Page").Activate
    End Sub

    Private Sub WorkSheet_Open()
    Range("A1").Activate
    End Sub
    Last edited by Blake 7; 03-07-2012 at 06:20 PM.
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  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: code for selecting cell A1 on activate worksheet.

    Blake 7,

    Please wrap your code in code tags
    As to your query, I think you're looking for something like this in the ThisWorkbook event module:
    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
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: code for selecting cell A1 on activate worksheet.

    Hi

    Try placing the following code in the ThisWorkbook module:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: code for selecting cell A1 on activate worksheet.

    this suffices:
    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)

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