Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Automatically Copy Information when data is entered

I have the following code in events of one tab of a spreadsheet. It copies
from the line above. I need it to copy a formula in the cells L1:V1. Please
show me where I should change the code to make it accomplish this task.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col J
On Error GoTo enditall
Application.EnableEvents = True
If Target.Cells.Column = 10 Then
N = Target.Row
If Me.Range("j" & N).Value < "" Then
With Me.Range("L" & N)
.Value = Format(Now, "mm-dd-yyyy hh:mm:ss")
.Offset(-1, 1).Resize(1, 10).Copy Destination:=.Offset(0, 1)



End With
End If
End If
enditall:
Application.EnableEvents = True
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Automatically Copy Information when data is entered

Do you mean copy formulas "from" L1:V1 to active row?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col J
Dim rng As Range
Set rng = Me.Range("L1:V1")
On Error GoTo enditall
Application.EnableEvents = True
If Target.Cells.Column = 10 Then
N = Target.Row
If Me.Range("j" & N).Value < "" Then
rng.Copy Destination:=Me.Range("L" & N)
End If
End If
enditall:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 25 May 2010 07:31:01 -0700, JOSEPH WEBER
wrote:

I have the following code in events of one tab of a spreadsheet. It copies
from the line above. I need it to copy a formula in the cells L1:V1. Please
show me where I should change the code to make it accomplish this task.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col J
On Error GoTo enditall
Application.EnableEvents = True
If Target.Cells.Column = 10 Then
N = Target.Row
If Me.Range("j" & N).Value < "" Then
With Me.Range("L" & N)
.Value = Format(Now, "mm-dd-yyyy hh:mm:ss")
.Offset(-1, 1).Resize(1, 10).Copy Destination:=.Offset(0, 1)



End With
End If
End If
enditall:
Application.EnableEvents = True
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Automatically Copy Information when data is entered

Thanks so much. that makes life ten times easier. Works perfectly

"JOSEPH WEBER" wrote:

I have the following code in events of one tab of a spreadsheet. It copies
from the line above. I need it to copy a formula in the cells L1:V1. Please
show me where I should change the code to make it accomplish this task.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col J
On Error GoTo enditall
Application.EnableEvents = True
If Target.Cells.Column = 10 Then
N = Target.Row
If Me.Range("j" & N).Value < "" Then
With Me.Range("L" & N)
.Value = Format(Now, "mm-dd-yyyy hh:mm:ss")
.Offset(-1, 1).Resize(1, 10).Copy Destination:=.Offset(0, 1)



End With
End If
End If
enditall:
Application.EnableEvents = True
End Sub


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
Data Base, copy information one sheet to another automatically Bill Bula Excel Discussion (Misc queries) 2 November 5th 07 01:04 PM
Copy formula automatically down when date is entered tommylux Excel Discussion (Misc queries) 15 October 11th 06 04:51 PM
How do I automatically copy contact information? Miguel Excel Discussion (Misc queries) 3 September 5th 06 04:50 PM
Moving a line of data when information is entered in a specific cell. opshmo Excel Discussion (Misc queries) 2 October 6th 05 06:08 PM
how can i automatically copy the information in one cell on a she. Dan Excel Worksheet Functions 1 November 26th 04 07:03 PM


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