dynamic filenames

kemperohlmeyer

Board Regular
Joined
Oct 4, 2006
Messages
73
I am writing a macro that saves multiple sheets after each one is calculated from a list.

ie, the sheet calculates, is exported as a webpage, new data pulled, calculated, exported etc.

How do i make the filename it is exported as reflect the data pulled in. For example if the data is from a company called KO the file should be named KO.

Thoughts?

Kemper
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
you define a variable as a string. You assign the company name to the string (plus any other test you want) and then save the file using the variable as the filename eg:

Dim strFileName as String

strFileName=Range("a1")

thisworkbook.saveas filename:=strFileName

etc
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,715
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top