#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default timestamp

I have this code to enter a timestamp in say a2 when a1 is changed

As i am importing data, the worksheet_change doesnt work, i need to us
worksheet calculate but am unable to code it,

any help would be aprieciated

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("A2:A10"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Su

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default timestamp

As i am importing data

Can you describe exactly what you mean by this?


--
Jim Rech
Excel MVP
"tommyboy " wrote in message
...
|I have this code to enter a timestamp in say a2 when a1 is changed
|
| As i am importing data, the worksheet_change doesnt work, i need to use
| worksheet calculate but am unable to code it,
|
| any help would be aprieciated
|
| Private Sub Worksheet_Change(ByVal Target As Excel.Range)
| With Target
| If .Count 1 Then Exit Sub
| If Not Intersect(Range("A2:A10"), .Cells) Is Nothing Then
| Application.EnableEvents = False
| If IsEmpty(.Value) Then
| Offset(0, 1).ClearContents
| Else
| With .Offset(0, 1)
| NumberFormat = "dd mmm yyyy hh:mm:ss"
| Value = Now
| End With
| End If
| Application.EnableEvents = True
| End If
| End With
| End Sub
|
|
| ---
| Message posted from http://www.ExcelForum.com/
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default timestamp

data is being imported from a text file, but as the worksheet_chang
doesnt work when importing data or when the cell is the result of
formula i cant use this cod

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default timestamp

Do you mean that you are doing a "File, Open"? If so the data comes into
Excel in a _new_ workbook. The worksheet_change event handler (or any event
handler) for another workbook or worksheet will not be invoked.

After you do the File, Open try copy/pasting the data into the worksheet
that has the worksheet_change event code.

--
Jim Rech
Excel MVP
"tommyboy " wrote in message
...
| data is being imported from a text file, but as the worksheet_change
| doesnt work when importing data or when the cell is the result of a
| formula i cant use this code
|
|
| ---
| Message posted from http://www.ExcelForum.com/
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default timestamp

I am using the get external data in excel so a cell will update
automatically into a new cell every time data is refreshed,

but as this is imported and not entered by user edit the
worksheet_change doesnt work,


---
Message posted from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default timestamp

Have you tried the After Refresh event?:

http://support.microsoft.com/default...87&Product=xlw

--
Jim Rech
Excel MVP
"tommyboy " wrote in message
...
|I am using the get external data in excel so a cell will update
| automatically into a new cell every time data is refreshed,
|
| but as this is imported and not entered by user edit the
| worksheet_change doesnt work,
|
|
| ---
| Message posted from http://www.ExcelForum.com/
|


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default timestamp

i basically want a worksheet_calculate to do thi

--
Message posted from http://www.ExcelForum.com

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
TimeStamp Chris Excel Discussion (Misc queries) 2 April 19th 10 10:15 PM
Timestamp juanpablo Excel Discussion (Misc queries) 3 November 2nd 07 01:55 PM
Timestamp ? elroyerni Excel Discussion (Misc queries) 2 June 1st 07 12:07 AM
Timestamp Sher Excel Discussion (Misc queries) 2 November 3rd 06 04:31 PM
Now as timestamp Lp12 Excel Worksheet Functions 5 August 13th 06 11:32 AM


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