Project Two - Sheet Number

  • Thread starter Thread starter Barry Wright
  • Start date Start date
B

Barry Wright

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
 
cSheet = activesheet.index

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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