VBA Debug: Workbook Open Rnage....Activate
Results 1 to 3 of 3

Thread: VBA Debug: Workbook Open Rnage....Activate

  1. #1
    Board Regular gheyman's Avatar
    Join Date
    Nov 2005
    Location
    Orlando, FL USA
    Posts
    1,574
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA Debug: Workbook Open Rnage....Activate

    IT doesn't like
    Sheet1.Range("C16").Activate


    [code]
    Private Sub Workbook_Open()
    Sheet1.Range("C16").Value = Environ("Username")
    Sheet1.Range("C17").Value = Now
    Sheet1.Range("C21").NumberFormat = "m/d/yyyy h:mm"
    Sheet1.Range("C16").Activate

    End Sub

    [Code/]
    [Code\]

    Thnaks
    Last edited by gheyman; Jul 21st, 2019 at 08:41 AM.
    G Heyman
    Northrop Grumman - Laser Systems'
    Apopka, FL

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    25,519
    Post Thanks / Like
    Mentioned
    444 Post(s)
    Tagged
    45 Thread(s)

    Default Re: VBA Debug: Workbook Open Rnage....Activate

    You have to activate the sheet, before you activate the cell.
    Alternatively use Application.Goto
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    5,263
    Post Thanks / Like
    Mentioned
    49 Post(s)
    Tagged
    14 Thread(s)

    Default Re: VBA Debug: Workbook Open Rnage....Activate

    What do you need to activate the cell for?
    Generally it is to get its value and for that you do not need to select the cell you can have this:

    Code:
    wValue = Sheet1.Range("C16").Value
    Regards Dante Amor

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •