Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default time stamp on MULTIPLE cells by PASTING

Though I have been provided with excellent macros for inserting a time stamp
on the corresponding cells of column C for each entry in column B but I'm not
able to achieve the goal when pasting an array on column B by getting a full
similar height of array on column C.

Please Help!

Thanx & regards
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default time stamp on MULTIPLE cells by PASTING

Faraz

I finally came up with this code that enters a time stamp in C for each range of
cells pasted into B.

If C has a time stamp, it will not change.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim myrange
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 2 Then
myrange = Target.Value
For Each myrange In Target
If myrange.Offset(0, 1).Value = "" Then
myrange.Offset(0, 1).Value = Format(Now, "h:mm:ss")
End If
Next
End If
enditall:
Application.EnableEvents = True
End Sub

Alternative........C changes when new cells are copied to B

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim myrange
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
myrange = Target.Value
Target.Offset(0, 1).Value = Now
End If
enditall:
Application.EnableEvents = True
End Sub

Gord

Just don't try to copy and paste an entire column

On Wed, 10 Jan 2007 23:03:00 -0800, FARAZ QURESHI
wrote:

Though I have been provided with excellent macros for inserting a time stamp
on the corresponding cells of column C for each entry in column B but I'm not
able to achieve the goal when pasting an array on column B by getting a full
similar height of array on column C.

Please Help!

Thanx & regards


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default time stamp on MULTIPLE cells by PASTING

GORD

U R GREAT!!!!!!!!!!

THANX AGAIN!!!!!!!!!!

"Gord Dibben" wrote:

Faraz

I finally came up with this code that enters a time stamp in C for each range of
cells pasted into B.

If C has a time stamp, it will not change.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim myrange
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 2 Then
myrange = Target.Value
For Each myrange In Target
If myrange.Offset(0, 1).Value = "" Then
myrange.Offset(0, 1).Value = Format(Now, "h:mm:ss")
End If
Next
End If
enditall:
Application.EnableEvents = True
End Sub

Alternative........C changes when new cells are copied to B

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim myrange
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
myrange = Target.Value
Target.Offset(0, 1).Value = Now
End If
enditall:
Application.EnableEvents = True
End Sub

Gord

Just don't try to copy and paste an entire column

On Wed, 10 Jan 2007 23:03:00 -0800, FARAZ QURESHI
wrote:

Though I have been provided with excellent macros for inserting a time stamp
on the corresponding cells of column C for each entry in column B but I'm not
able to achieve the goal when pasting an array on column B by getting a full
similar height of array on column C.

Please Help!

Thanx & regards



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
Date and time stamping multiple cells for multiple entries. Gerald Excel Worksheet Functions 1 May 9th 06 01:45 PM
link multiple cells to multiple cells jpoltor Excel Discussion (Misc queries) 2 March 25th 06 08:59 AM
Combine Date & Time Cells KrunoG Excel Discussion (Misc queries) 0 January 31st 06 08:08 PM
Combine Date & Time Cells Bob Phillips Excel Discussion (Misc queries) 0 January 31st 06 07:04 PM
Time Stamp without change AntonyY Excel Discussion (Misc queries) 3 November 26th 04 09:13 AM


All times are GMT +1. The time now is 08:21 AM.

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"