Consulting

Results 1 to 3 of 3

Thread: Run-time error 438: Object doesn't support this property or method

  1. #1
    VBAX Newbie
    Joined
    May 2018
    Posts
    2
    Location

    Run-time error 438: Object doesn't support this property or method

    Hi all Im trying to clear multiple range and im getting this run-time error 438 and not sure how to fix it could someone help
    Please.

    Here is my code
    Sub Clearticket()
    
    Range("B6:B11,I6:I9,B13:F14,B16:F17,H13:K31,A34,A14,A17").Select
    Selection.ClearContents '<-------error on this line
    InsertFormul
    ActiveSheet.Range("K3").Select
    ActiveCell.Value = Date
    
    End Sub
    Last edited by Paul_Hossler; 05-28-2018 at 06:06 PM. Reason: CODE Tags

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    1. I added CODE tags to your post - you can use the [#] icon and paste the macro between them to format it

    2. I had no problem once I commented out the InsertFormul line which didn't compile

    3. You can operate on objects with out selecting them


    Option Explicit
    Sub Clearticket()
        Range("B6:B11,I6:I9,B13:F14,B16:F17,H13:K31,A34,A14,A17").ClearContents
        ActiveSheet.Range("K3").Value = Date
    End Sub
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Newbie
    Joined
    May 2018
    Posts
    2
    Location
    Quote Originally Posted by Paul_Hossler View Post
    1. I added CODE tags to your post - you can use the [#] icon and paste the macro between them to format it

    2. I had no problem once I commented out the InsertFormul line which didn't compile

    3. You can operate on objects with out selecting them


    Option Explicit
    Sub Clearticket()
        Range("B6:B11,I6:I9,B13:F14,B16:F17,H13:K31,A34,A14,A17").ClearContents
        ActiveSheet.Range("K3").Value = Date
    End Sub
    Thanks all works now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •