Change Name of Workbook - Automatically

  • Thread starter Thread starter sosteffo
  • Start date Start date
S

sosteffo

I dont know if this at all possible, but i would like a workbook that
would say "balanced" - "Not Balance" etc..

depending on the results in the spreadsheet, i.e 2 figures balance to
zero,

This would help me tremendously.........or is it just be lazy......well
it would stop error from happening in the future

Thanks
 
Hi
this is only possible with VBA. Lets assume you have calculated the
balance in cell A1. I
Put the following code in your worksheet module (not in a standard
module)

Private Sub Worksheet_Calculate()
application.enableevents = false
On Error GoTo CleanUp:
With Me.Range("A1")
If .Value = 0 Then
Me.Name = "Balanced"
else
Me.Name = "Not Balanced"
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub
 
Put the following code in your worksheet module (not in a standard
module)

????

Sorry i don't understand.....
 
Frank:

Could be a problem if the OP had more than 1 worksheet in the workbook
Could be trying to give the same name to two sheets with the usua
result.

How about tagging the actual name with a symbol or word - eg Marc
Balanced ,Feb Unbalanced and providing for removing the tag if th
balance gets disturbed?

They tell me latest versions of Excel let you colour the tabs. If tha
is so, could be nice to colour red the accounts that are in the red!

Al
 
They tell me latest versions of Excel let you colour the tabs. If
that
is so, could be nice to colour red the accounts that are in the red!

Hi
possible with Excel 2002+
Frank
 
Thanks for the guide on Worksheet procedures, i now understand were th
code should go..

Yet the code doesn't appear to work......funny thing is that with th
code no ERROR occured when i select the sheet, if i change anything i
brings up an error and returns me to VB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top