+ Reply to Thread
Results 1 to 4 of 4

Macro Error - New error used to work

Hybrid View

M4RSH Macro Error - New error used... 12-20-2013, 06:43 AM
Kaper Re: Macro Error - New error... 12-20-2013, 06:48 AM
Olly Re: Macro Error - New error... 12-20-2013, 06:50 AM
M4RSH Re: Macro Error - New error... 12-21-2013, 05:52 AM
  1. #1
    Registered User
    Join Date
    11-27-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2010
    Posts
    41

    Macro Error - New error used to work

    Sub Clearing()
    
    results = MsgBox("Are you sure you want to clear the contents of this call score?", vbYesNo, "")
    If results = vbYes Then
        Range("E2:E7,G2:G7,H9:I9,H11:H87,H90:H95,H98:H102,H105:H108,E126:I126").ClearContents ""
        Range("E2").Select
        Save = MsgBox("Do you wish to save the file now?", vbYesNo, "")
        If Save = vbYes Then
            ActiveWorkbook.Save
        End If
    End If
    When I run this macro, I get this error - Compile Error - Wrong number of arguments or invalid property assignment and highlights the first Range row.

    This used to work and all I have done is changed E126:I126 from E123:I123, I don't understand why it now doesn't.
    Last edited by zbor; 06-06-2014 at 04:20 AM.
    All the Best,

    Marshall

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Macro Error - New error used to work

    delete
    ""
    from the end of the highlighted line (after clearcontents)

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro Error - New error used to work

    Get rid of "" after ClearContents.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Registered User
    Join Date
    11-27-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Macro Error - New error used to work

    cheers guys, marked as solved and rep added for everyone !

+ 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. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  2. [SOLVED] Simple Calendar pop up macro --> error Run-time error '424': Object required
    By am_hawk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2013, 10:38 AM
  3. Macros stop to work when work sheet is protected. Run time error 1004
    By sellim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2012, 01:14 AM
  4. Print Macro / module error & Update / Clear Macro error
    By mal.b.graham in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-28-2012, 06:40 PM
  5. [SOLVED] Macro error - Run time error 1004 (App defined/Object Defined error)
    By jlax34 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-06-2012, 03:02 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