View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Can I have the TAB name be a calculated field...?

Works fine for me: trying entering data in any cell.

"Kelvin Beaton" wrote:

Ok, non of the sugestions seem to work...

I have a calacualted field in D5 on a data... what is supposed to fire this
off?
I put this code in Sheet3 and the sheet TAB still says Sheet3
When I open the spreadsheet it asked me if I want to enable Macros, and I
say yes...

I seem to be missing something in what I'm doing...
I right mouse clicked on the tab and choose View Code and pasted it there. I
pretty sure that's what I was supposed to do...

Private Sub Worksheet_Calculate()
Const sCELLADDRESS As String = "D5" 'Change to suit
On Error Resume Next
Me.Name = Range(sCELLADDRESS).Text
On Error GoTo 0
End Sub

Can you think of anything I'm doing wrong?

Thanks

Kelvin

PS sorry, I do want the format of the date to be 2-2-07...



"JE McGimpsey" wrote in message
...
One way:

Put this in your worksheet code module (right-click the worksheet tab
and choose View Code):


Private Sub Worksheet_Calculate()
Const sCELLADDRESS As String = "H35" 'Change to suit
On Error Resume Next
Me.Name = Range(sCELLADDRESS).Text
On Error GoTo 0
End Sub



In article ,
"Kelvin Beaton" <kelvin at mccsa dot com wrote:

I have a spreadsheet that has a calculated date field in "=H34+3"

I would love for the TAB to equal that value.

I think I've tried to figure this out a long time back, but I think I got
stuck becasue it is a calculated fileld.

Anyone know if this can be done, and how?

Thanks

Kelvin