+ Reply to Thread
Results 1 to 6 of 6

Object Issue

  1. #1
    Registered User
    Join Date
    04-01-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    14

    Object Issue

    Hi,

    Think i have an object issue below as the loop code previously worked. i've attached a word document showing the screen print and have scoured the internet but simply cannot remove the error
    The CurrentMth Value shows up as teh correct string when i hover above it.
    Any pointers appreciated

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Leith Ross; 06-16-2013 at 12:36 AM. Reason: Added Code Tags

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,234

    Re: Object Issue

    Hi,

    Try this:

    Set TargetWS = ActiveWorkbook.Sheets(CurrentMth)
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Object Issue

    You need to set worksheets and range objects (like Marvin said)

    Please Login or Register  to view this content.
    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Registered User
    Join Date
    04-01-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Object Issue

    Thanks. This worked great!

  5. #5
    Registered User
    Join Date
    04-01-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Object Issue

    Thanks. That's the first time I've seen the colons used in code too which i think is easier on the eyes than double lines.

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Object Issue

    Glad I could help. You will often see the colon used an If/ Else/ End If statement with something like "Else:". Other times I find it nice to use the colons is when we loop.

    For example:
    Please Login or Register  to view this content.
    Hope this helps.

    abousetta

    P.S. If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Thanks.

+ 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