Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Project Two - Sheet Number
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Project Two - Sheet Number
cSheet = activesheet.index
-- HTH RP (remove nothere from the email address if mailing direct) "Barry Wright" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Project Two - Sheet Number
try acivesheet.index
"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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Counting number of hours per project per team | Excel Discussion (Misc queries) | |||
Calculate number days + hours to complete a project | Excel Worksheet Functions | |||
How to project the due date according to a number of working hours | Excel Discussion (Misc queries) | |||
How to project the due date according to a number of working hours | Excel Worksheet Functions | |||
Deploying excel sheet with a VB project | Excel Programming |