That's closer. This is how I rewrote it:
In a module for the ThisWorkbook object
Private Sub Workbook_Open()
Sheet1.Range("A2").FormulaR1C1 = ThisWorkbook.FullName
End Sub
It doesn't matter if the user renames Sheet1 or the cell A2 as these are absolute references.
Thanks, but why does it display the old location after I move it then open it again? If I go to other worksheets then back to the Sheet1 the location refreshes. When does this Worksheet Activate event fire if not on the opening of the Workbook?
I need to have a cell in an Excel worksheet display the full path of the file and the date the file was created or maybe modified. I've worked with VBA in Access, but never in Excel.
I got the answer on a related forum. Here is my application of the best answer which was simply Me.Parent.Name
Private Sub ScheduledDate_Exit(Cancel As Integer)
Dim myparent As String
myparent = Me.Parent.Name
If myparent = "frmProposals" Then...
I appreciate all the examples, and I think every answer would work for me, but PaulF gave me all I really needed with me.parent.name. Short, sweet, done!
Private Sub ScheduledDate_Exit(Cancel As Integer)
Dim myparent As String
myparent = Me.Parent.Name
If myparent = "frmProposals"...
In Access2000 I have a subform used by two different main forms. On the exit event of one of the subforms fields I want to setfocus on a field on the open main form, so that the user doesn't get stuck tabbing inside the subform. How can VBA determine which of two main forms is open so that I...
In Access2000 I have a subform used by two different main forms. On the exit event of one of the subforms fields I want to setfocus on a field on the open main form, so that the user doesn't get stuck tabbing inside the subform. How can VBA determine which of two main forms is open so that I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.