Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Changed cell row number...


Hi

I have a requirement in which I am getting some problem. Lets say I have four columns in a sheet. If first three columns are entered with some values, I need to compute some thing and put it in fourth column. For that purpose I am using "Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)" function. Here the problem I am facing is, in this function, how to get the row number in which the data has been changed?

If I am not clear, let me explain clearly. If data in cells(3,1), cells(3,2) and cells(3,3) is changed, then I need to compute some thing and put it in cells(3,4). Here how to trap the row number as 3 in side the "Workbook_SheetChange" function.

Thanks in advance

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Changed cell row number...


The Target parameter is a range object, so you can look at
Target.Row
to get the row.

Couple of things to watch for:
1. Target can (I think) be a multi-cell range so you will need to
iterate through the range to make sure you catch all changed rows
2. If you make a change in the SheetChange code then this will in turn
trigger your code again and so on.... You can temporarily disable
events using
Application.eneableevents=false
to prevent this.

Tim.


"Sridhar Pentlavalli via OfficeKB.com" wrote in
message ...

Hi

I have a requirement in which I am getting some problem. Lets say I
have four columns in a sheet. If first three columns are entered
with some values, I need to compute some thing and put it in fourth
column. For that purpose I am using "Private Sub
Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)"
function. Here the problem I am facing is, in this function, how to
get the row number in which the data has been changed?

If I am not clear, let me explain clearly. If data in cells(3,1),
cells(3,2) and cells(3,3) is changed, then I need to compute some
thing and put it in cells(3,4). Here how to trap the row number as 3
in side the "Workbook_SheetChange" function.

Thanks in advance

--
Message posted via http://www.officekb.com



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
Format changed when the details in cell changed angel Excel Worksheet Functions 9 July 15th 08 12:36 AM
enter number in cell when font color is changed Suzi Excel Discussion (Misc queries) 3 October 12th 07 02:30 AM
letters across the top has changed to number tina Excel Discussion (Misc queries) 2 August 23rd 06 05:19 PM
number changed to zero toolb Excel Worksheet Functions 2 January 2nd 05 02:42 PM
Number changed to Text nate axtell Excel Programming 2 June 15th 04 12:45 PM


All times are GMT +1. The time now is 11:50 PM.

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"