+ Reply to Thread
Results 1 to 14 of 14

Trouble with macro - Loop through all work sheets

  1. #1
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Trouble with macro - Loop through all work sheets

    Good Morning,

    Having a bit of trouble trying to get this macro to work for every sheet.

    Can't seem to get it to loop through all of them.

    I think its something to do with the active sheet line veing wrong for what I'm trying. Any any ideas? Any help will be greatly appreciated.
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Trouble with macro - Loop through all work sheets

    Please Login or Register  to view this content.
    INTO

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Re: Trouble with macro - Loop through all work sheets

    Still now working I'm afraid. It just runs for the active page.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Trouble with macro - Loop through all work sheets

    Rich Tea,
    When you run the macro, does it loop through each WS1?

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Re: Trouble with macro - Loop through all work sheets

    Actually,

    It is looping through the pages, but it's not creating the appointments, just putting today's date into the 'check' cells. Any idea's why it wouldnt be creating the appointments?

  6. #6
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Re: Trouble with macro - Loop through all work sheets

    Still Not got this working yet, any clues why it wouldn't be creating the appointments?

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Trouble with macro - Loop through all work sheets

    RichTea,
    Sorry! I am unble to test your code as I do no have outlook setup on my Laptop

  8. #8
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Re: Trouble with macro - Loop through all work sheets

    Ah That's no worries AB33. Thanks for your help so far anyways!

    I'm sure someone will spy whats wrong evenutally. Always find problems most difficult to solve when it's almost working but not quite!

  9. #9
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Re: Trouble with macro - Loop through all work sheets

    Sorry,

    Still trying to get some idea's on this one

  10. #10
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Re: Trouble with macro - Loop through all work sheets

    Come on guys I know theres some whiz kid out there who can crack this problem with just a glance!

  11. #11
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Re: Trouble with macro - Loop through all work sheets

    Okay, so this is what seems to be happening.

    It loops fine for the due appointments on the active page, if theres more than one on the same page it creates an appointment for each.

    However, it won't create appointments due on other sheets within the workbook, but it does loop through them and return a date value.

    Can anyone give me any idea why it does this?

  12. #12
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Re: Trouble with macro - Loop through all work sheets

    Okay, so this is what seems to be happening.

    It loops fine for the due appointments on the active page, if theres more than one on the same page it creates an appointment for each.

    However, it won't create appointments due on other sheets within the workbook, but it does loop through them and return a date value.

    Can anyone give me any idea why it does this?

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

    Re: Trouble with macro - Loop through all work sheets

    Does this make a dfference?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  14. #14
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Re: Trouble with macro - Loop through all work sheets

    Norie, You Sir are a gentleman and a scholar.

    You're the Whiz Kid I was speaking about!

    Many thanks for your help!

    R

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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