+ Reply to Thread
Results 1 to 3 of 3

Open different folder related with week number

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Lisbon
    MS-Off Ver
    Excel 2003
    Posts
    37

    Open different folder related with week number

    Hello every one.
    I have a VBA Form.
    And every time i click on the button they execute the followed code:

    PHP Code: 
    Private Sub CommandButton10_Click()
    'Me.Hide
    '
    UserForm1.Show
    Workbooks
    .Open Filename:="\\pttudor\GROUP\GERAL\Montagem\FY19\Planos de Produção\01 April\week 17\RESUMO FABRICAÇÃO WK17.xlsm"
    Me.Hide
    Windows
    ("PORTAL MONTAGEM.xlsm").Activate
    Windows
    ("PORTAL MONTAGEM.xlsm").Close
    End Sub 
    But every week this code should change.
    Next week should open

    "\\pttudor\GROUP\GERAL\Montagem\FY19\Planos de Produção\02 May\week 18\RESUMO FABRICAÇÃO WK18.xlsm"
    next
    "\\pttudor\GROUP\GERAL\Montagem\FY19\Planos de Produção\02 May\week 19\RESUMO FABRICAÇÃO WK19.xlsm"
    next
    "\\pttudor\GROUP\GERAL\Montagem\FY19\Planos de Produção\02 May\week 20\RESUMO FABRICAÇÃO WK20.xlsm"
    next
    "\\pttudor\GROUP\GERAL\Montagem\FY19\Planos de Produção\02 May\week 21\RESUMO FABRICAÇÃO WK21.xlsm"
    next
    "\\pttudor\GROUP\GERAL\Montagem\FY19\Planos de Produção\02 May\week 22\RESUMO FABRICAÇÃO WK22.xlsm"

    then

    "\\pttudor\GROUP\GERAL\Montagem\FY19\Planos de Produção\03 June\week 23\RESUMO FABRICAÇÃO WK23.xlsm"


    any one have one idea how to do that Automatically ?

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Open different folder related with week number

    put the weeknumber in a cell for example A1 then change your codeline to

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-30-2012
    Location
    Lisbon
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: Open different folder related with week number

    Sorry but not work.
    i make a table with procv formula.
    On Sheet2 on cell D5 have now the month and on C4 have the week number.

    PHP Code: 
    Workbooks.Open Filename:="\\pttudor\GROUP\GERAL\Montagem\FY19\Planos de Produção\& Range("d5")&\Week " Range("c4") & "\RESUMO FABRICAÇÃO WK" Range("c4") & ".xlsm" 
    what i want its open the

    PHP Code: 
    Workbooks.Open Filename:="\\pttudor\GROUP\GERAL\Montagem\FY19\Planos de Produção\04 April\Week 17\RESUMO FABRICAÇÃO WK17.xlsm" 
    something its wrong. what i dont know my knowledge its also limited.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Number of Items open longer than 1 week but less than 2 weeks
    By Roger Govier in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 11:05 AM
  2. Number of Items open longer than 1 week but less than 2 weeks
    By Roger Govier in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 04:05 AM

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