Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Change Event

I'm using the Worksheet_Change Event to put som information in Column D if
changes happens i Column C.

If I type ie anything in C3, "ABC" is added in D3. I Can later Delete the
"ABC" manually. This works perfectly allrigt. My problem is, that if I
Delete the contents og C3 then I do not want D3 to change. So is thefre a
way I can check if the change is a Clearcontent. I've tried with

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 And Target.ClearContents = True Then
Exit Sub
Else
If Target.Column = 3 Then
If Range("D" & Target.Row) = "" Then
Range("D" & Target.Row) = Range("INITIALER").Value
End If
End If
End If
End Sub


But that makes anything types i Columsn C to be deleted.

Jan



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Change Event

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 And Target.Value = "" Then
Exit Sub
Else
If Target.Column = 3 Then
If Range("D" & Target.Row) = "" Then
Range("D" & Target.Row) = Range("INITIALER").Value
End If
End If
End If
End Sub

--
Gary''s Student - gsnu2007c


"Jan Kronsell" wrote:

I'm using the Worksheet_Change Event to put som information in Column D if
changes happens i Column C.

If I type ie anything in C3, "ABC" is added in D3. I Can later Delete the
"ABC" manually. This works perfectly allrigt. My problem is, that if I
Delete the contents og C3 then I do not want D3 to change. So is thefre a
way I can check if the change is a Clearcontent. I've tried with

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 And Target.ClearContents = True Then
Exit Sub
Else
If Target.Column = 3 Then
If Range("D" & Target.Row) = "" Then
Range("D" & Target.Row) = Range("INITIALER").Value
End If
End If
End If
End Sub


But that makes anything types i Columsn C to be deleted.

Jan




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Change Event

Of Course! Thank you.

Jan

Gary''s Student wrote:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 And Target.Value = "" Then
Exit Sub
Else
If Target.Column = 3 Then
If Range("D" & Target.Row) = "" Then
Range("D" & Target.Row) = Range("INITIALER").Value
End If
End If
End If
End Sub


I'm using the Worksheet_Change Event to put som information in
Column D if changes happens i Column C.

If I type ie anything in C3, "ABC" is added in D3. I Can later
Delete the "ABC" manually. This works perfectly allrigt. My problem
is, that if I Delete the contents og C3 then I do not want D3 to
change. So is thefre a way I can check if the change is a
Clearcontent. I've tried with

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 And Target.ClearContents = True Then
Exit Sub
Else
If Target.Column = 3 Then
If Range("D" & Target.Row) = "" Then
Range("D" & Target.Row) = Range("INITIALER").Value
End If
End If
End If
End Sub


But that makes anything types i Columsn C to be deleted.

Jan



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
How do I change a Worksheet_change event to a beforesave event? Tueanker Excel Programming 5 June 29th 07 03:00 PM
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 PM
Change event and calculate event Antje Excel Programming 1 March 29th 05 09:03 PM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM


All times are GMT +1. The time now is 08:47 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"