Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Trigger code

I think this is what is called an event trigger, but how to use?
Columms C to L have data in them from rows 30 to row 68. Each columm i
a different company (thus there are 10 companies). Each columm i
numbered 1 to 10 (thus C has number 1 in row 28, D has number 2 in ro
28, etc)...up to number 10 in columm L row 28.

Columm M and N are empty but I want to trigger an event in ro
28....when I enter for example, number 3(in row 28M) and number 6(i
row 28N), it will copy and paste the data from the correspondin
columms that have does numbers in row 28 into columm M and N...

Any thoughts?
Thanks,
B.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Trigger code

I am not sure I exactly follow, but, have you considered the
worksheet_change event? You can test the cell address being
changed and the corresponding value in row 28 and use that
to make the changes.

Regards,
Doug


"Bourbon " wrote in message

Columm M and N are empty but I want to trigger an event in row
28....when I enter for example, number 3(in row 28M) and number 6(in
row 28N), it will copy and paste the data from the corresponding
columms that have does numbers in row 28 into columm M and N...



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

Look at the template I attached...you will understand then. I believe i
is actually quite simply to do but I have never done it before so????

I'ts basically a copy and paste function that is triggered when yo
enter some number..

Thanks,
B

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Trigger code

Paste this into the Worksheet code section for that sheet. Some of the MVP's
could certainly do better.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cl As Range
If Target.Row = 28 And IsNumeric(Target.Value) And Not IsEmpty(Target) Then
For Each cl In Target.EntireRow.Cells
If cl.Value = Target.Value Then GoTo found
Next cl
found:
If cl.Address = Target.Address Then
MsgBox "Company Not Found"
Else
Range(cl, Cells(73, cl.Column)).Copy
Target.PasteSpecial (xlPasteValues)
End If
ElseIf IsEmpty(Target) And Target.Column < 1 Then
Range(Target, Cells(73, Target.Column)).ClearContents
End If

End Sub


"Bourbon " wrote in message ...
Look at the template I attached...you will understand then. I believe it
is actually quite simply to do but I have never done it before so????

I'ts basically a copy and paste function that is triggered when you
enter some number..

Thanks,
B.


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



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

Doug, like you said, the code was crude but I did the trick and I thank
you very much for it.

If you don't mind, I might have another question about another code
later to ask you....

Thanks again,
B.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Trigger code

You're welcome.
For future code questions, just ask the group in a new
thread. I don't hang out here a lot so would be unlikely
to answer in a timely fashion.

Regards,
Doug


"Bourbon " wrote in message ...
Doug, like you said, the code was crude but I did the trick and I thank
you very much for it.

If you don't mind, I might have another question about another code
later to ask you....

Thanks again,
B.


---
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
Trigger and Add-in Automatically JackR Excel Discussion (Misc queries) 2 May 4th 08 02:34 PM
Trigger or code Curt Excel Discussion (Misc queries) 0 April 20th 07 03:32 PM
Trigger code if certian data is present Jim G Excel Discussion (Misc queries) 2 April 20th 07 09:46 AM
trigger help climax Excel Worksheet Functions 1 February 2nd 06 04:39 PM
How to code a timer to trigger a sub-routine ? Joseph[_10_] Excel Programming 1 December 18th 03 12:48 PM


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