ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to use VBA to name sheets ? (https://www.excelbanter.com/excel-programming/368294-how-use-vba-name-sheets.html)

vumian[_15_]

how to use VBA to name sheets ?
 

I have a file that i do not know how many sheet are there in before

i need to copy contain of C4 to name of sheets

Thank for your help

--
vumia
-----------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...fo&userid=3649
View this thread: http://www.excelforum.com/showthread.php?threadid=56478


Tom Ogilvy

how to use VBA to name sheets ?
 
Sub Renamesheets()
dim sh as Worksheet
for each sh in workbook.Worksheets
sh.name = sh.Range("C4").Value
Next
end Sub


would be my guess of what you want

--
Regards,
Tom Ogilvy


"vumian" wrote:


I have a file that i do not know how many sheet are there in before

i need to copy contain of C4 to name of sheets

Thank for your help.


--
vumian
------------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494
View this thread: http://www.excelforum.com/showthread...hreadid=564789



vumian[_44_]

how to use VBA to name sheets ?
 

hi Tom Ogilvy,

thank you for help, but there is a little problem here

IF C4 OF PER SHEET IS SAME ? THERE IS A ERROR HERE ?
How to popup for this case

thank you for help one more


--
vumian
------------------------------------------------------------------------
vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494
View this thread: http://www.excelforum.com/showthread...hreadid=564789



All times are GMT +1. The time now is 12:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com