+ Reply to Thread
Results 1 to 9 of 9

Renaming a filepath within a Macro script

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Renaming a filepath within a Macro script

    --------------------------------------------------------------------------------

    Hi,

    First off, Im extremely new to VBA.
    I have a macro script in development at the moment to automatically send emails with attachments through Lotus Notes and I need a piece of code that can automatically change the 'date' (eg. 24-02-10) in each of the filepaths on my UserForm Sub.

    Any help on this would be greatly appreciated.
    Cheers

    Tony

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Renaming a filepath within a Macro script

    It would help if you posted your existing code. Remember to use code tags.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Renaming a filepath within a Macro script

    Quote Originally Posted by Andy Pope View Post
    It would help if you posted your existing code. Remember to use code tags.
    HEy Andy,
    Im useing variations of the below code.


    Please Login or Register  to view this content.
    This code is running against a userform such as below

    Please Login or Register  to view this content.
    I just need a code that can change the dates (e.g 17-02-10) as needed.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Renaming a filepath within a Macro script

    Something like this.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Renaming a filepath within a Macro script

    Thats great man, cheers very much.
    Ill bang it in to my code now and do afew tests but it should work fine.

    Will this code change any date informortion in the Module code aswell as the Userform code?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Renaming a filepath within a Macro script

    The code won't but you can use the principle to change your code where dates are required.

  7. #7
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Renaming a filepath within a Macro script

    Cheers man your a star.

    If i wanted to apply
    Please Login or Register  to view this content.
    to a UserForm with a text box and command button, so that the date entered into the Txt box would become the " & strDate &", is there a code for that?

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Renaming a filepath within a Macro script

    You can put the contents of the textbox in to a variable.
    This would expect the text to be correctly formatted.

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Renaming a filepath within a Macro script

    Cheers again man, youve been a great 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