ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sheet name VBA (https://www.excelbanter.com/excel-programming/300933-sheet-name-vba.html)

Jack

sheet name VBA
 
Hi

I just wonder how to change a sheet name the from vba code in excel..

Thanks for your help

Jac


Ron de Bruin

sheet name VBA
 
Try this Jack

Sub test()
On Error Resume Next
ActiveSheet.Name = "Hi"
On Error GoTo 0
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jack" wrote in message ...
Hi,


I just wonder how to change a sheet name the from vba code in excel...

Thanks for your help

Jack




Bob Flanagan

sheet name VBA
 
ActiveSheet.Name ="new name"

or

worksheets("sheet1").Name ="New Name"

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Jack" wrote in message
...
Hi,


I just wonder how to change a sheet name the from vba code in

excel...

Thanks for your help

Jack




Harald Staff

sheet name VBA
 
Hi Jack

Adding: When you're stuck on simple operations and their syntax, record a
macro while doing it manually:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 09.06.2004 by Harald Staff
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Joe"
End Sub

HTH. Best wishes Harald

"Jack" skrev i melding
...
Hi,


I just wonder how to change a sheet name the from vba code in

excel...

Thanks for your help

Jack





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

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