Thread: add target
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
nowfal[_48_] nowfal[_48_] is offline
external usenet poster
 
Posts: 1
Default add target


Hi,
I wanted to add one more cell to this sheet change code, its alread
a cell(A10)
the second cell is (B4). I have tried lot, not getting the result.
hope somebody will be help.


Private Sub Worksheet_Change(ByVal Target As Range)
Dim iPos As Long

On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If .Address = "$A$10" Then
If Len(.Value) 62 Then
iPos = InStrRev(.Value, " ", 63)
If iPos 0 Then
.Offset(1, 0).Value = Right(.Value, Len(.Value) - iPos)
.Value = Left(.Value, iPos)
End If
End If
End If
End With

ws_exit:
Application.EnableEvents = True
End Sub


with regards
nowfal

--
nowfa
-----------------------------------------------------------------------
nowfal's Profile: http://www.excelforum.com/member.php...fo&userid=1000
View this thread: http://www.excelforum.com/showthread.php?threadid=39939