Hi all, I'm not very good at VBA and had lots of help building the code below...just want to modify so the workbook always opens on the sheet called Journal,
I've got the following code already in the VBA section "This WorkBook" and have added the final part of the code which I hoped would get it to open on the worksheet called "Journal" (see the very last part of the code below)
but I'm getting a Compile error: Ambiguous name detected: Workbook_Open
Was hoping someone would be able to help me fix
Private Sub Workbook_Open()
Call Initialise
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
blnClosing = True
dteEarliestTime = Now + TimeSerial(0, 0, 1)
Application.OnTime dteEarliestTime, "IsThisClosed"
End Sub
Private Sub Workbook_Activate()
Call Initialise(True)
End Sub
Private Sub Workbook_Deactivate()
If blnClosing Then
Application.OnTime dteEarliestTime, "IsThisClosed", , False
Else
Call DeInitialise
End If
End Sub
Private Sub Worksheet_Deactivate()
Call DeInitialise
End Sub
Private Sub Worksheet_Activate()
Call Initialise
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
On Error Resume Next
If Sh.Name = "Analyse" Then
MsgBox "ALWAYS REFRESH DATA Before Using This Sheet", vbInformation, "INBUILT, A Smarter Way To Trade"
End If
On Error Resume Next
If Sh.Name = "Calendar" Then
MsgBox "ALWAYS REFRESH DATA Before Using This Sheet", vbInformation, "INBUILT, A Smarter Way To Trade"
End If
End Sub
Private Sub Workbook_Open()
Sheets("Journal").Select
Range ("A1")
End Sub
I've got the following code already in the VBA section "This WorkBook" and have added the final part of the code which I hoped would get it to open on the worksheet called "Journal" (see the very last part of the code below)
but I'm getting a Compile error: Ambiguous name detected: Workbook_Open
Was hoping someone would be able to help me fix
Private Sub Workbook_Open()
Call Initialise
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
blnClosing = True
dteEarliestTime = Now + TimeSerial(0, 0, 1)
Application.OnTime dteEarliestTime, "IsThisClosed"
End Sub
Private Sub Workbook_Activate()
Call Initialise(True)
End Sub
Private Sub Workbook_Deactivate()
If blnClosing Then
Application.OnTime dteEarliestTime, "IsThisClosed", , False
Else
Call DeInitialise
End If
End Sub
Private Sub Worksheet_Deactivate()
Call DeInitialise
End Sub
Private Sub Worksheet_Activate()
Call Initialise
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
On Error Resume Next
If Sh.Name = "Analyse" Then
MsgBox "ALWAYS REFRESH DATA Before Using This Sheet", vbInformation, "INBUILT, A Smarter Way To Trade"
End If
On Error Resume Next
If Sh.Name = "Calendar" Then
MsgBox "ALWAYS REFRESH DATA Before Using This Sheet", vbInformation, "INBUILT, A Smarter Way To Trade"
End If
End Sub
Private Sub Workbook_Open()
Sheets("Journal").Select
Range ("A1")
End Sub