Discussion Locked

Use string as part of filename in Excel XP VBA

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How do you take a string value and insert it into an excel vba saveas/savecopyas code line. The string value is 2 digits from an input box.
e.g activeworkbook.savecopyas( "\\directory\default filename text & [string from input box] & more default filename text.xls)

3 replies

by dklippert

MyValue = InputBox("Enter 2 digits","A Input Box")

activeworkbook.savecopyas( "\\directory\default filename text" & MyValue & "more default filename text.xls")

This discussion is closed to new replies.