VBA Debug: Workbook Open Rnage....Activate

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,341
Office Version
  1. 365
Platform
  1. Windows
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:

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You have to activate the sheet, before you activate the cell.
Alternatively use Application.Goto
 
Upvote 0
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 = [COLOR=#333333]Sheet1.Range("C16").Value[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top