tags:

views:

64

answers:

2

Hello Everyone :

I have been wrestling with this since yesterday but gotten nowhere,was hoping someone could show me the light

I have this workbook in which I have the following 2 requirements :

1)if the user enters a value(which is a date) in column A : the value of '2' is automatically filled in column C

2)

a- if the user enters a positive number (+) in column D (eg : +100) : the value of 'DEP' is automatically filled in column 'H'

b- if the user enters a negative number (-) in column D (eg : -50) : the value of 'WD' is automatically filled in column 'H'.

Again as pointers would be much appreciated.

Many thanks

+2  A: 

Can't this be done using regular formula?

Column H: =IF(VALUE(D1) >= 0, "DEP", "WD")

shahkalpesh
thanks kalpesh,but I am dealing with very large amounts of trading data:i have column D populating from another sheet,so there is no user who will actually do the cut and paste,anywayz my code is posted below
arun prakash
A: 
Private Sub Worksheet_Change(ByVal Target As Range) 

Dim cell As Range 

On Error Goto ws_exit 

Application.EnableEvents = False 

If Target.Row > 1 Then 

    If Not Intersect(Target, Me.Columns(1)) Is Nothing Then 

        For Each cell In Target 

            cell.Offset(0, 2).Value = 2 
        Next cell 

    ElseIf Not Intersect(Target, Me.Columns(4)) Is Nothing Then 

        For Each cell In Target 

            If cell.Value > 0 Then 

                cell.Offset(0, 4).Value = "DEP" 
            Else 

                cell.Offset(0, 4).Value = "WD" 
            End If 
        Next cell 
    End If 
End If 
arun prakash
shahkalpesh
none: this is the solution 2 my question
arun prakash