+ Reply to Thread
Results 1 to 3 of 3

wrong numbers of arguments or invalid property

  1. #1
    Registered User
    Join Date
    11-29-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    19

    wrong numbers of arguments or invalid property

    Hi, all!

    Got some issues with my macro.
    It is a very basic, simple macro, but for some reason, it stops working:

    Is there any chance anyone knows how to fix it?

    Here below is the PrintScreen from Excel, and macro itself.

    Range.jpg



    Sub Performances_Clear()

    Dim Answer As Integer


    Answer = MsgBox("Do you want to delete the data?", vbYesNo + vbCritical, "Delete Data")

    If Answer = vbYes Then

    range ("C6:C105")
    range("C111:C210").ClearContents
    range("F6:F105").ClearContents
    range("F111:F210").ClearContents

    range("C6:C105").ClearComments
    range("C111:C210").ClearComments
    range("F6:F105").ClearComments
    range("F111:F210").ClearComments

    range( _
    "G6:G105,H6:H105,I6:I105,J6:J105,K6:K105,L6:L105,M6:M105,N6:N105,G111:G210,H111:H210,I111:I210,J111:J210,K111:K210,L111:L210,M111:M210,N111:N210" _
    ).Select
    Selection.ClearContents

    range( _
    "G6:G105,H6:H105,I6:I105,J6:J105,K6:K105,L6:L105,M6:M105,N6:N105,G111:G210,H111:H210,I111:I210,J111:J210,K111:K210,L111:L210,M111:M210,N111:N210" _
    ).Select
    Selection.ClearComments

    range("C6").Select

    Else: MsgBox "Canceled"

    End If

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: wrong numbers of arguments or invalid property

    It looks like you have named something 'range' - probably a variable or function. That's not a good idea, so I suggest you change its name to something else.
    Rory

  3. #3
    Registered User
    Join Date
    11-29-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    19

    Re: wrong numbers of arguments or invalid property

    Quote Originally Posted by rorya View Post
    It looks like you have named something 'range' - probably a variable or function. That's not a good idea, so I suggest you change its name to something else.
    Thank you, sir! I did indeed!

+ 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. wrong number of arguments or invalid property assignment vb6
    By vosit in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2013, 05:40 AM
  2. Wrong number of arguments or invalid property assignement
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-13-2013, 05:39 AM
  3. [SOLVED] wrong number of arguments invalid or property assignment error
    By uduyt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2013, 07:40 PM
  4. wrong number of arguments or invalid property assignment
    By fish88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2012, 05:23 AM
  5. wrong number of arguments invalid or property assignment error
    By uduyt in forum Access Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2012, 08:39 AM
  6. Replies: 1
    Last Post: 06-27-2006, 11:45 AM
  7. Wrong Number of Arguments or Invalid Property Assignment???
    By tbassngal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2006, 12:10 PM
  8. Wrong number of Arguments or Invalid property assignment
    By Turin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2005, 05:05 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