Please Login or Register to view this content.
Please Login or Register to view this content.
kathhying,
You named a variable "name". Name is a built-in method in VBA used to rename a disk file, directory, or folder. So the variable "name" was getting confused with the VBA method Name. Change the variable "name" to "nam" or "nm" and you'll be fine
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Put "Option Explicit" at the top of your code and work with some of your variable names. I see the name array (which my excel didn't like for some reason), but I also see a Names array, Occur array, Numcust,
Hi kathhying
What error message are you getting and at what line of code. I see
and then I seePlease Login or Register to view this content.
which saysPlease Login or Register to view this content.
???????Please Login or Register to view this content.
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please mark your Thread as SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
As a statement of fact, your thread title is pretty accurate.
It probably would have been helpful to have explained where the problem was encountered.
As tigeravatar pointed out, name is a reserved word.
But, as jstephens has pointed out, there are one or two more errors in the code. Your naming is inconsistent and you use variables that you haven't defined. Option explicit will help you to identify them.
The code below runs but the Occurs variable needs to be defined and calculated.
Please Login or Register to view this content.
Note that if you just press enter at the first InputBox, you'll get a blank MsgBox output.
Regards
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks