davedave24
Programmer
Hi guys. How would I reference the parent folder (of a workbook) in a cell reference, in code?
Currently I have this:
This goes to the All Deliveries 2011 (or whatever current year) workbook, goes to a specific row, then references the value in column G.
If however I move this workbook into a new folder, how would I reference the parent folder? i.e.
All Deliveries 2011.xlsx is in the parent folder
Workbook in question (where the cell reference is) is in a subfolder.
I'm looking for something like
Currently I have this:
This goes to the All Deliveries 2011 (or whatever current year) workbook, goes to a specific row, then references the value in column G.
Code:
.Range("H13").Formula = "=SUM('[All Deliveries " & Year(Date) & ".xlsx]REVENUE'!$G$" & RowNumber & "/20)"
If however I move this workbook into a new folder, how would I reference the parent folder? i.e.
All Deliveries 2011.xlsx is in the parent folder
Workbook in question (where the cell reference is) is in a subfolder.
I'm looking for something like
Code:
.Range("H13").Formula = "=SUM('[[b]Thisworkbook.parentfolder\[/b]All Deliveries " & Year(Date) & ".xlsx]REVENUE'!$G$" & RowNumber & "/20)"