Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting number of hours per project per team The Fool on the Hill Excel Discussion (Misc queries) 3 December 30th 08 07:39 AM
Calculate number days + hours to complete a project pfm Excel Worksheet Functions 1 January 23rd 08 02:29 AM
How to project the due date according to a number of working hours Eric Excel Discussion (Misc queries) 8 October 24th 05 11:44 AM
How to project the due date according to a number of working hours Eric Excel Worksheet Functions 1 October 21st 05 03:03 PM
Deploying excel sheet with a VB project anthony Excel Programming 1 October 31st 04 12:31 PM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"