Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Format changed when the details in cell changed | Excel Worksheet Functions | |||
enter number in cell when font color is changed | Excel Discussion (Misc queries) | |||
letters across the top has changed to number | Excel Discussion (Misc queries) | |||
number changed to zero | Excel Worksheet Functions | |||
Number changed to Text | Excel Programming |