+ Reply to Thread
Results 1 to 9 of 9

activate a window based on date

  1. #1
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    activate a window based on date

    Hi all, I need to activate a window based on a date format and a name.
    The codde I used doesn't work in excel 2010, but does in excel 2007?
    [CODE]Windows("name" & Format(Date, "ddmm")).Activate[CODE\]
    I Need to have it work on both 2007 and 2010. Any help will be great
    Creating POS

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: activate a window based on date

    Why do you want/need to activate the window/workbook?


    If you do have you tried something like this?
    Please Login or Register  to view this content.
    PS You kind of got the code tags upside down, wrong way roundish - the easiest way to add them is to select the code and click the # button on the toolbar above the post window.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: activate a window based on date

    My workbook activates other workbooks, and then when my main workbook is inactive I get errors, so the code runs before all or any userform is activated to ensure no errors. Its a bit baffeling. Why does the code work in 2007?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: activate a window based on date

    Can you post the rest of the code and explain what it's meant to do?

  5. #5
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: activate a window based on date

    Its only a button that calls a userform, its a 2 line code, second line is "userform1.show vbmodeless" nothing tricky. I prefer using single line commands. The code u provided gives me a subscript out of range error.
    Last edited by simeonmein; 02-06-2014 at 02:45 AM.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: activate a window based on date

    Is that the same error your original code causes?

  7. #7
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: activate a window based on date

    Jip, but I think if I change the destination of the code to the actual userform that it calls (in the userform initialize), my problem should be solved?

  8. #8
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: activate a window based on date

    You may try and include the extension:
    Please Login or Register  to view this content.
    for example.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  9. #9
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: activate a window based on date

    Good idea, I like ur trail of thought.

+ 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. [SOLVED] Activate cell based on Today's date?
    By country101 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-24-2014, 07:05 PM
  2. Macro to Activate Window With Dynamic Date Reference
    By alpha608 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2013, 04:54 PM
  3. Activate window
    By stojko89 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-18-2011, 07:45 AM
  4. Activate Window
    By marcjwright in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-09-2007, 07:26 AM
  5. Workbook.Activate / Window.Activate problem
    By Tim in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2006, 07:40 PM

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