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
VB ScriptMicrosoft Excel
Last Comment
rutgermons
8/22/2022 - Mon
Qlemo
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.