You can do this by pushing ALT+F11 then right clicking on "ThisWorkBook" on
the left, and left clicking on view code.
Then paste in the following
Private Sub Workbook_Open()
Sheets("NameOfSheet").Cells(1, 1).Value = Worksheets.Count
End Sub
When the worksheet opens it'll count the number of worksheets and put this
value in a specified cell. So in this case if you had a sheet named
NameOfSheet it would put a number in Row 1, Column A.
Hope this helped.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Whoops
Application.EnableEvents = False
Range("A1").Value = ExecuteExcel4Macro("GET.DOCUMENT(50)")
Whoops:
Application.EnableEvents = True
End Sub
Rick
"NateBuckley" <NateB...@discussions.microsoft.com> wrote in message
news:F0A18399-21EB-4124...@microsoft.com...
i would like to have a general code which i can use in all worksheets of my
workbooks
please help.
"Rick Rothstein (MVP - VB)" <rick.new...@NO.SPAMverizon.net> wrote in
message news:eTm1qcVm...@TK2MSFTNGP05.phx.gbl...
Cant you just use the Header or the Footer section where excel can give you
that automatically ?
Regards
Jean-Yves
"S N" <uand...@yahoo.com> wrote in message
news:OyZ7nnVm...@TK2MSFTNGP05.phx.gbl...
"Jean-Yves TFELT" <noSpam@I_Hate_Spam> wrote in message
news:12077381...@ecw.eurocontrol.be...
Rick
"S N" <uand...@yahoo.com> wrote in message
news:ecgyUw8...@TK2MSFTNGP06.phx.gbl...