Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Excel 2003; Windows XP SP2
Good day, I am working on some VBA subs and I keep getting a error when I try to run a sub that tries to select a range of cells I see: "Compile Error. Wrong number of arguments or Invalid property assignment." I even tried just a really basic macro and having Excel record the macro and do the code for me. I pressed record, and then selected a range of cells in a single column and then pressed stop recording. I looked at the code and this is the code that was written: Range("M2:M20").Select I try to run this macro and I get the same error. Any ideas? Please advise. Thanks, |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is that the line that's highlighted when the compiler errors out? That
line looks valid to me. I wonder if the "wrong number of arguments" is occuring on another line of code- simply putting a different range in causes that other line to error out. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Have you been playing with user defined functions?
Any chance you created a UDF named Range? If you did, then change its name to something else and test your code once more. Brent E wrote: Excel 2003; Windows XP SP2 Good day, I am working on some VBA subs and I keep getting a error when I try to run a sub that tries to select a range of cells I see: "Compile Error. Wrong number of arguments or Invalid property assignment." I even tried just a really basic macro and having Excel record the macro and do the code for me. I pressed record, and then selected a range of cells in a single column and then pressed stop recording. I looked at the code and this is the code that was written: Range("M2:M20").Select I try to run this macro and I get the same error. Any ideas? Please advise. Thanks, -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks to you both for your responses.
I've not been been using any user defined functions or UDF named Range to my knowledge, what would be an example of such? In regard to second question, that was the only line of code in the test macro but still gave me an error. Not sure why? I haven't had time to retest them this morning. I tried closing the program and reopening, but no difference. I will try rebooting and see if that makes any difference. "Dave Peterson" wrote: Have you been playing with user defined functions? Any chance you created a UDF named Range? If you did, then change its name to something else and test your code once more. Brent E wrote: Excel 2003; Windows XP SP2 Good day, I am working on some VBA subs and I keep getting a error when I try to run a sub that tries to select a range of cells I see: "Compile Error. Wrong number of arguments or Invalid property assignment." I even tried just a really basic macro and having Excel record the macro and do the code for me. I pressed record, and then selected a range of cells in a single column and then pressed stop recording. I looked at the code and this is the code that was written: Range("M2:M20").Select I try to run this macro and I get the same error. Any ideas? Please advise. Thanks, -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Nested IF's with Logical Arguments - Doing something wrong here | Excel Discussion (Misc queries) | |||
Nested IF's with Logical Arguments - Doing something wrong here | Excel Discussion (Misc queries) | |||
Nested IF's with Logical Arguments - Doing something wrong her | Excel Discussion (Misc queries) | |||
Nested IF's with Logical Arguments - Doing something wrong her | Excel Discussion (Misc queries) | |||
Nested IF's with Logical Arguments - Doing something wrong here | Excel Discussion (Misc queries) |