LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Macro for creating dynamic filenames

I'm sure this is going to end up being convoluted, but if anyone can help
with this I will be so ecstatic!

I have an excel file that contains business names (Business), a unique ID
that will be used later for generating a letter (LetterID), and a month
field that tracks what month a particular order took place (Month). There
are other fields, but these are the only ones I'm concerned with. I will be
using this excel file for a mail merge with a letter template that will
generate a letter for each of the businesses in the list. There will be an
entry in the spreadsheet for everytime a business placed an order, so if
Business XYZ placed 12 orders for the time period I'm dealing with, then
there will be 12 instances of "XYZ" in the Business column of the
spreadsheet...and the month column will contain either Mar, Apr, or May
depending on when the order was placed.

Here is the problem...I'm wanting to add a field to the spreadsheet called
"Filename" that will concatenate together the business name, the unique
letter ID used for them this letter, and the months that the letter will
include information for. So essentially the filename template would look
like this:

BusinessName_LetterID_Months06

where Months could be any combination of Mar, Apr, and/or May and the 06 is
just marking the year.

Now concatenating the first 2 things is no problem...but figuring out how to
determine whether the Months should be Mar, MarApr, MarMay, MarAprMay, Apr,
AprMay, or May is causing me to pull my hair out. It's easy enough if there
is only one entry for a business because then obviously the "Months" part of
the filename will simply be whatever value is in "Month"...but if there is
more then one entry for the business, how can I programmatically find out
which months need to be included in the filename?

I hope this makes sense...my brain seems to be turning to mush over this.

-Brian


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
dynamic sort macro across 3 linked sheets wrpalmer Excel Discussion (Misc queries) 0 December 11th 05 02:17 AM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Highlight Range - wrong macro, please edit. Danny Excel Worksheet Functions 8 October 19th 05 11:11 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 09:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"