range error

KDS14589

Board Regular
Joined
Jan 10, 2019
Messages
182
Office Version
  1. 2016
Platform
  1. Windows
I'm new to VBA so be gentle.
This just started happening today.
Whenever I select a preexisting command button to a macro, I get an error window listing the range as "Wrong number of arguments or invalid property assignment"
What can I do now?

Code:
Sub clearswitchboard()
     Sheets("general.switchboard").Select
    RANGE("R57:AR155").Select
    Selection.ClearContents
    RANGE("af51").Select
End Sub
 
Cross posted https://chandoo.org/forum/threads/range-error.43034/

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I had to go back to a file copy I made a few days ago that didn't have this error showing up, now I'm in the process of updating that old copy at same time comparing it to the one that's shows error. I'm retired and this program is for myself and a learning one too, so got plenty of time and no big headache
Thank goodness I saveas a new copy every day for times like this.
Thanks to everyone for help.
 
Upvote 0
As I said on Chandoo (which you have seemingly ignored) check that you don't have any procedures or variables called "Range"
 
Upvote 0
I too am retired and have plenty of time as well, but not enough patience (I am trying to be gentle) to be ignored.

That said... Good luck!
 
Upvote 0
As I said on Chandoo (which you have seemingly ignored) check that you don't have any procedures or variables called "Range"
i'm new at this maybe my reply did not post
I may have done something wrong
sorry
 
Upvote 0
same goes to you too
sorry I'm new at this so my reply may not have posted or I forgot
sorry
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top