Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rob Rob is offline
external usenet poster
 
Posts: 718
Default VBA language question.

I know very little about VBA coding. I found an event macro in another
thread on this board to enter a date/time stamp in a cell when a chanage was
made in a range of cells. The code was written for a range that was a single
column and used .offset(0,1) to determine where the date was entered (see the
macro below). I am trying to modify this macro for a three demensional range
(a1:h12) and want the date to be stored in the same row as the active cell
but in column I. I am sure this is a simple change but it is beyond my
knowlege - any help?

The following is the macro I am trying to modify:

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

Rob
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 156
Default VBA language question.

check your post in microsoft.public.excel.programming for a fix


Sandy


Rob wrote:
I know very little about VBA coding. I found an event macro in another
thread on this board to enter a date/time stamp in a cell when a chanage was
made in a range of cells. The code was written for a range that was a single
column and used .offset(0,1) to determine where the date was entered (see the
macro below). I am trying to modify this macro for a three demensional range
(a1:h12) and want the date to be stored in the same row as the active cell
but in column I. I am sure this is a simple change but it is beyond my
knowlege - any help?

The following is the macro I am trying to modify:

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

Rob


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
=bahttext(A1) please tell me about language in english how can i after applying hte fomula สองพันบา Excel Worksheet Functions 0 April 4th 06 03:58 AM
Set language option in Excel Bartosz Excel Discussion (Misc queries) 0 March 13th 06 07:50 PM
language support in excel sheet using a third party language tool seema Excel Worksheet Functions 0 March 13th 06 06:06 AM
Question about combining data from multiple workbooks into one rep BookOpenandUpright Excel Discussion (Misc queries) 2 February 19th 05 12:37 PM
An easy macro question and one I believe to be a little more diffi TroutKing Excel Worksheet Functions 3 January 18th 05 09:17 PM


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