Thread
:
resequence my worksheets
View Single Post
#
2
Posted to microsoft.public.excel.programming
FreeBird
external usenet poster
Posts: 1
resequence my worksheets
Hello
If i did catch well, you want to rename the "VBA" name of sheets.
I wrote this below for personal use.
You can simplify it, the important codeline is the last one.
Sub vbp_SheetCodeName_DEMO()
Call vbp_SheetCodeName(ActiveSheet, "test") ', Workbooks("Classeur1"))
End Sub
Sub vbp_SheetCodeName(varSheet As Variant, varSheetCompName As String,
Optional varWorkbook As Variant)
'
If TypeName(varSheet) = "string" Then
Set varSheet = ActiveWorkbook.Sheets(varSheet)
End If
If Not IsMissing(varWorkbook) And TypeName(varWorkbook) = "string"
Then
Set varWorkbook = Workbooks(varWorkbook)
ElseIf IsMissing(varWorkbook) = True Then
Set varWorkbook = ActiveWorkbook
End If
' the important line :
varWorkbook.VBProject.VBComponents(varSheet.CodeNa me).name =
varSheetCompName
End Sub
HTH
--
FreeBird
------------------------------------------------------------------------
FreeBird's Profile: 1701
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=193483
http://www.thecodecage.com/forumz
Reply With Quote
FreeBird
View Public Profile
Find all posts by FreeBird