Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default help with worksheet change event

What i'd like to do is if a single cell in column I is changed, then in
column J of the same row I want to set the value to Date (today's date).
As a double check column B on the same row must also be populated

It's imperative drag and drop, and delete row events don't try and
populate column J
--
Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default help with worksheet change event

Try this Mike

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count < 1 Then Exit Sub
If Not Application.Intersect(Range("I:I"), Target) Is Nothing Then
If Target.Offset(0, -7).Value < "" Then
Target.Offset(0, 1).Value = Format(Now, "mm-dd-yy hh:mm:ss")
End If
End If
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Mike NG" wrote in message ...
What i'd like to do is if a single cell in column I is changed, then in
column J of the same row I want to set the value to Date (today's date).
As a double check column B on the same row must also be populated

It's imperative drag and drop, and delete row events don't try and
populate column J
--
Mike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default help with worksheet change event

On Mon, 15 Sep 2003 at 22:55:50, Ron de Bruin (Ron de Bruin
) wrote:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count < 1 Then Exit Sub
If Not Application.Intersect(Range("I:I"), Target) Is Nothing Then
If Target.Offset(0, -7).Value < "" Then
Target.Offset(0, 1).Value = Format(Now, "mm-dd-yy hh:mm:ss")
End If
End If
End Sub

Superb

Now I have two ways of updating my sheet - either manual input on the
sheet, or by some userforms I have on the page. Is there a way of
saying, "don't run the worksheet_change" event and turn it back on again
later

Cheers
--
Mike
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default help with worksheet change event

Hi Mike

You can use a cell on your worksheet for example with
Yes or No in it to turn it off.

You can use this as first line then in the change event

If Range("A1").Value = "No" Then Exit Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Mike NG" wrote in message ...
On Mon, 15 Sep 2003 at 22:55:50, Ron de Bruin (Ron de Bruin
) wrote:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count < 1 Then Exit Sub
If Not Application.Intersect(Range("I:I"), Target) Is Nothing Then
If Target.Offset(0, -7).Value < "" Then
Target.Offset(0, 1).Value = Format(Now, "mm-dd-yy hh:mm:ss")
End If
End If
End Sub

Superb

Now I have two ways of updating my sheet - either manual input on the
sheet, or by some userforms I have on the page. Is there a way of
saying, "don't run the worksheet_change" event and turn it back on again
later

Cheers
--
Mike



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default help with worksheet change event

On Tue, 16 Sep 2003 at 00:27:19, Ron de Bruin (Ron de Bruin
) wrote:
You can use a cell on your worksheet for example with
Yes or No in it to turn it off.

You can use this as first line then in the change event

If Range("A1").Value = "No" Then Exit Sub

I've just remembered :- Application.EnableEvents = False is what I need
--
Mike
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
Worksheet Change Event Tony S.[_2_] Excel Discussion (Misc queries) 11 February 18th 09 01:04 AM
Worksheet change Event ranswert Excel Worksheet Functions 1 January 17th 08 11:17 PM
Worksheet Change event DoctorG Excel Discussion (Misc queries) 4 February 15th 06 12:53 PM
Worksheet Change Event TonyM Excel Discussion (Misc queries) 8 March 11th 05 12:52 PM
Worksheet Row Change event crazybass2 Excel Discussion (Misc queries) 4 December 8th 04 05:29 PM


All times are GMT +1. The time now is 04:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"