View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Project Two - Sheet Number

Barry

Change to.....cSheet = ActiveSheet.Index

Gord Dibben Excel MVP


On Thu, 25 Nov 2004 14:13:39 -0500, Barry Wright wrote:


I have now started my 2nd VBA Excell Project...Wo Hoo! I have
changed my Name for this Project.


With the fllowing Sub I was trying to return the Sheet NUMBER a
cell was changed on. (1, 2, 3, 4, etc) This will not work of course,
because "ActiveSheet.Name" returns the sheet NAME, not Number. Anyone
know how to do this?

Private Sub Workbook_SheetChange()
Dim cRow as Long
Dim cCol as Long
Dim cSheet as Long

cRow = Target.Row
cCol = Target.Column
cSheet = ActiveSheet.Name
MSGBOX cSheet
End Sub