+ Reply to Thread
Results 1 to 7 of 7

select mo/yr w/data validation list, insert celll entry into vba file reference code

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    Eureka, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    select mo/yr w/data validation list, insert celll entry into vba file reference code

    Hi

    I have a spreadsheet at work that i use to print out monthly paperwork. One thing I need to print is a calendar(word document). I would like to be able to select a month and year(one cell formatted mmmm-yyyy or January-2011) and get the cell results into the file name reference in my code.

    Example: User selects "January-2011" from a drop down list and hits a command button to print a the calendar which is file named January-2011-XX.doc(the x's represent client initials and are part of the file name) I already have code that works great and would just like to know how to get the cell results into the file name reference. Thanks in advance for the help

  2. #2
    Registered User
    Join Date
    12-09-2011
    Location
    Eureka, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: select mo/yr w/data validation list, insert celll entry into vba file reference c

    I just decided I could shorten this question to the following:

    Can you add a cell entry into a file reference within code, if so how? Thanks again excel guru's

  3. #3
    Valued Forum Contributor
    Join Date
    12-05-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    308

    Re: select mo/yr w/data validation list, insert celll entry into vba file reference c

    Hi Shannon

    Try the FORMAT command:
    Please Login or Register  to view this content.
    Regards, Rob.

  4. #4
    Registered User
    Join Date
    12-09-2011
    Location
    Eureka, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: select mo/yr w/data validation list, insert celll entry into vba file reference c

    awesome that looks like it will do the trick, I can't wait to try it out tomorrow. Thanks for the speedy reply I'll let you know how it works tomorrow

  5. #5
    Registered User
    Join Date
    12-09-2011
    Location
    Eureka, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: select mo/yr w/data validation list, insert celll entry into vba file reference c

    I'm pretty newbie at this, so I hope this follow up question isn't dumb. I haven't tried this yet but it occurs to me I may not know exactly how, this is what I think

    strMyFileName = Format(Range("A1"), "mmmm-yyyy") & "XX.doc"

    and then in the file path put C:/MyFolder/MyClient/Calendar/strMyFileName

    is that wrong? Hope you are still awake, thanks again for your help

  6. #6
    Registered User
    Join Date
    12-09-2011
    Location
    Eureka, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: select mo/yr w/data validation list, insert celll entry into vba file reference c

    or maybe change the filepath to:

    c:/myfolder/myclient/calendar/Format(Range("A1"), "mmmm-yyyy") & "XX.doc"

    if it isn't one of those i may be lost in the morning lol

  7. #7
    Registered User
    Join Date
    12-09-2011
    Location
    Eureka, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: select mo/yr w/data validation list, insert celll entry into vba file reference c

    Hi Rob are you still out there?

    I tried that out today but I'm afraid my ignorance did me in. I'm not quite sure how to implement your code. The code I found on google works great and prints out the files I need but it uses a complete file path to print out my docs(c:\mydocs\calendar\filename). So I dont know how to replace the filename with your code that will create a filename. These are the 2 things i tried today

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thanks again for ur help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1