Link to home
Start Free TrialLog in
Avatar of rutgermons
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
Avatar of Qlemo
Qlemo
Flag of Germany image

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
Avatar of CvD
CvD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rutgermons
rutgermons

ASKER

Thanks CvD, your comment was the most complete solution and worked for me!

cheers