Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
332 views
in Technique[技术] by (71.8m points)

excel - VBA code to add new sheets with a template based on selected range

So, I have an excel File where I have created a macro, which when run, lets me choose a range of my choice, which when selected, creates new sheet by those names after the second page (Index Page). But with the above code, there could be a chance that the sheet name I want to add already exists or I might have a blank cell in that name range.

In that case, I need a code that can verify if the sheet with the same name already exists or if its a blank cell.
If both conditions are fulfilled only then it should add a new sheet.

Also, While this new sheet is being created, i have a sheet called template from where i would like the data to be copied from in the new sheet.

Do not create a sheet if its a blank cell.

If sheet already exists then show me a message: "Sheet x(sheet name) already exists.

question from:https://stackoverflow.com/questions/65661673/vba-code-to-add-new-sheets-with-a-template-based-on-selected-range

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...