Using Microsoft 365
VBA File save location.
In a VBA routine I save the DATA output to a file location.
My 1st attempt saved the file successfully by hard coding the path.
Set ws = Worksheets("Data")
custname = Range("B2")
path = "C:\Users\myname\Documents\Test file\excel\"
fname = custname
My 2nd attempt saved the file successfully when I pointed to a cell on the same sheet (DATA).
Set ws = Worksheets("Data")
custname = Range("B2")
path = Range("A1")
fname = custname
What I really want to do, is get path from a cell on a different sheet – Sheet: Header, Cell E2. How do I tell the routine to go to the Header to pick up the path name?
Do you need more infortmation?
Thank you for your help.
VBA File save location.
In a VBA routine I save the DATA output to a file location.
My 1st attempt saved the file successfully by hard coding the path.
Set ws = Worksheets("Data")
custname = Range("B2")
path = "C:\Users\myname\Documents\Test file\excel\"
fname = custname
My 2nd attempt saved the file successfully when I pointed to a cell on the same sheet (DATA).
Set ws = Worksheets("Data")
custname = Range("B2")
path = Range("A1")
fname = custname
What I really want to do, is get path from a cell on a different sheet – Sheet: Header, Cell E2. How do I tell the routine to go to the Header to pick up the path name?
Do you need more infortmation?
Thank you for your help.