Problem to Merge command

What is the reason to get
due to Merge command of attached file below?
LVL 12
HuaMin ChenProblem resolverAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You will get that prompt if you try to merge the cells if they are not empty and in the end, the merged cells will contain the value from the left most cell of the merged cells.
HuaMin ChenProblem resolverAuthor Commented:
How to avoid current problem?
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
When you are getting that error?
Which sheet is present before running the code in your attached file?
If I run the code in the existing file, it will throw an error as there cannot be two sheets in the workbook with the same name and your are adding the sheets and renaming them without checking if the sheet name is already taken.

So please upload a file without running the code so that it doesn't have an extra sheet.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
BTW you may add the following line to ignore that prompt...

Application.DisplayAlerts = False

Open in new window

HuaMin ChenProblem resolverAuthor Commented:
I already have this line
Application.DisplayAlerts = False    

Open in new window

and error is due to

            WorkRng.Parent.Range(rng.Cells(i, 1), rng.Cells(j - 1, 1)).Merge

Open in new window

if you have a try to run macro in attached file.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
I ran the code and it completed without any such error.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.