Thread
:
Renaming worksheets
View Single Post
#
6
Posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
Posts: 10,124
Renaming worksheets
try
ThisWorkbook.VBProject.VBComponents(ActiveSheet.Co deName) _
..Name = Format(Range("a1"), "mmmm_yyyy")
--
Don Guillett
SalesAid Software
"Jim May" wrote in message
news:mfqug.103189$IZ2.14130@dukeread07...
Don: I substituted
ActiveSheet.CodeName = mystr
To change to Codename, but get error 450
Wrong number of arguments or invalid property assignment
Can this be corrected to achieve?
TIA,
Jim
"Don Guillett" wrote in message
:
Sub namesheet()
mystr = Range("A1") & " " & Range("b1")
'mystr = Range("A1") 'merged a1 & b1
MsgBox mystr
ActiveSheet.Name = mystr
End Sub
--
Don Guillett
SalesAid Software
"Jeff Saunders" <Jeff
wrote in
message
...
I am trying to do some of the same thing except with merged cells. I am
using cells A1, A2, B1, & B2 for the month and year and I would like
that
in
the worksheet name. I am making a calendar for a motel to use to book
its
rooms.
I opened VBA for the worksheet and put that in, but nothing happened.
I
changed the cell range from $a$1 to $a$1..$b$2.
Thanks.
Jeff
"Bob Phillips" wrote:
Mike,
Try this code
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Address = "$A$1" Then
Sh.Name = Target.Value
End If
ws_exit:
Application.EnableEvents = True
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Mike Allen" wrote in message
...
I am trying to rename a worksheet by using a defined field (cell).
Example,
if I type in Dave Wilson in cell A1, is there a way to define the
worksheet
as Dave Wilson, without manually changing it everytime? And as I
cahnge
names, the worksheet names will change also...Thanks in advance for
your
time.
Mike allen
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett