Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trigger and Add-in Automatically | Excel Discussion (Misc queries) | |||
Trigger or code | Excel Discussion (Misc queries) | |||
Trigger code if certian data is present | Excel Discussion (Misc queries) | |||
trigger help | Excel Worksheet Functions | |||
How to code a timer to trigger a sub-routine ? | Excel Programming |