Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Auto populate a cell

I can automatically insert the time in the column to the right of one cell
by using Select Case Target Address in the Worksheet Change event by
specifying each individual case.

Is it possible to insert the time in a range of cells that I specify (i.e.
C7:C23) if I enter a date into B7:B23? I can't seem to perform the event
unless I specify the case for each individual target.

Thanks,

Sam


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Auto populate a cell

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "B7:B23"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsDate(.Value) Then
.Offset(0, 1).Value = Format(Time, "hh:mm:ss")
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Sam Ricca" wrote in message
...
I can automatically insert the time in the column to the right of one cell
by using Select Case Target Address in the Worksheet Change event by
specifying each individual case.

Is it possible to insert the time in a range of cells that I specify (i.e.
C7:C23) if I enter a date into B7:B23? I can't seem to perform the event
unless I specify the case for each individual target.

Thanks,

Sam




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
Auto populate cell Shek5150 Excel Discussion (Misc queries) 3 November 12th 08 05:19 PM
Formating a cell to auto populate Aldo Setting up and Configuration of Excel 1 November 16th 07 01:19 PM
How do I Auto Populate a cell with a chart based on a value Bryan[_2_] Excel Worksheet Functions 0 March 24th 07 01:03 AM
auto populate cell based on previous cell drop down list selectio. PuzzledbyLists Excel Discussion (Misc queries) 2 September 11th 06 01:28 AM
Auto Populate a cell Bellsouth Excel Discussion (Misc queries) 3 March 30th 05 02:27 PM


All times are GMT +1. The time now is 12:43 AM.

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"