Nicolaf
10-22-2013, 10:51 AM
Hi,
I have some code that opens a file name contained in a specific cell (C4).
Because rows are added each day this specific cell changes daily I therefore need to make reference to cell dynamic.
"Final List" is sheet which contains cell C4 where file name is.
Code below:
Private Sub CommandButton3_Click()
IName = ThisWorkbook.Sheets("Final List").Range("C4").Value 'name with extension
Set NewWkbk = Workbooks.Open(Filename:="P:\Lonib\" & IName)
End Sub
I could reference Range("C4") in a way that 4 becomes dynamic.
I could for example have C stay the same but the number (in our case 4) will be the number found in Cell A1 (which will increase accordingly as rows are added).
How can I amend the code above so that Range takes C & A1 as opposed to simply C4?
:dunno :think:
Nix
I have some code that opens a file name contained in a specific cell (C4).
Because rows are added each day this specific cell changes daily I therefore need to make reference to cell dynamic.
"Final List" is sheet which contains cell C4 where file name is.
Code below:
Private Sub CommandButton3_Click()
IName = ThisWorkbook.Sheets("Final List").Range("C4").Value 'name with extension
Set NewWkbk = Workbooks.Open(Filename:="P:\Lonib\" & IName)
End Sub
I could reference Range("C4") in a way that 4 becomes dynamic.
I could for example have C stay the same but the number (in our case 4) will be the number found in Cell A1 (which will increase accordingly as rows are added).
How can I amend the code above so that Range takes C & A1 as opposed to simply C4?
:dunno :think:
Nix