rutgermons
asked on
vb macro strFileName based in field in excel sheet
folks
how can i make my output file name exported from excel (using a macro) be named after a field in the excel sheet itself?
i.e. the value from B1 from sheet 1
strDefFolder = Trim(InputBox(" Enter path to save file", "File Location", ""))
system = field B1
strFileName = system & Day
All help will do
how can i make my output file name exported from excel (using a macro) be named after a field in the excel sheet itself?
i.e. the value from B1 from sheet 1
strDefFolder = Trim(InputBox(" Enter path to save file", "File Location", ""))
system = field B1
strFileName = system & Day
All help will do
You can use e.g. System = [B1].Value or System = Range("B1").Value if you are in Sheet1, or System = [Sheet1!B1].Value if in another sheet. Even better, name your field, and use that name instead of B1.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks CvD, your comment was the most complete solution and worked for me!
cheers
cheers