How to rename cell names in many tabs using vba and macro?

Last Edited By Krjb Donovan
Last Updated: Mar 05, 2014 09:41 PM GMT

QuestionEdit

QUESTION: I am trying to rename many cells in 5 different tabs. For example A1 is currently = TEST and I want A1 = TESTALL How can I accomplish it using VBA and macro. Please advise. Thank you kindly

ANSWER: Not clear what you want to do globally - are all names to have ALL added to them?

see

http://www.mrexcel.com/forum/showthread.php?t=85484

for a discussion of this.

---------- FOLLOW-UP ----------

QUESTION: Thanks I figured it out but I am still trying to figure out if I have macro in one sheet how can I run it on another sheet without having to copy and paste the macro everytime? Please advise === Answer ===

A macro can refer to all sheets, or specific sheets - so for instance

for each sh in activeworkbook.sheets sh.name=sh.name & "-test" next

would go through all worksheets

or

sheets("MySheet").range("a1").value=1

would set a1 on MySheet to 1

does this help?!

My email if it is of any use is aidan.heritage@virgin.net

QuestionEdit

I am trying to rename many cells in 5 different tabs. For example A1 is currently = TEST and I want A1 = TESTALL

How can I accomplish it using VBA and macro. Please advise. Thank you kindly

AnswerEdit

Sara

An easy way to do it is to make all of the sheets active then type in TESTALL in cell A1 and it will rename cell A1 in all of the sheets to TESTALL.

To make all of the sheets active, click on the sheet 1 tab (or whatever it is named), then hold down the shift key and click on the other tabs that you want to make active.

Advertisement

©2024 eLuminary LLC. All rights reserved.