View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Erik Midtrød Per Erik Midtrød is offline
external usenet poster
 
Posts: 8
Default Contitional copying of cells from one tab to another

Assign the following macro to a button:

Sub CopyHighRisk()
Dim r As Long
Dim i As Long
i = 2
For r = 2 To 10 ' Assuming one header row and nine questions
If Sheet1.Range("e" & r).Value = 7 Then
Sheet2.Range("a" & i).Value = Sheet1.Range("a" & r).Value
Sheet2.Range("b" & i).Value = Sheet1.Range("b" & r).Value
Sheet2.Range("e" & i).Value = Sheet1.Range("e" & r).Value
i = i + 1
End If
Next
End Sub

Might not be the most sophisticated solution, but at least it is
working.

Per Erik

On Thu, 18 Aug 2005 13:00:34 -0400, "Junkyard Engineer"
wrote:

20 years + ago, I was once a programmer.But I need to know where to go and
how to start this.

It's for a risk management project. On one tab, I have a list of question
(cell B) and the risk evaluation (cell E) from 1 to 9 (number)

What I want to do is to copy all E cells that are in the 7 to 9 range to a
contingency table on another excel tab in the same workbook. I need to copy
the Code number, the name of the risk and the risk evaluation (that would be
cell A, B and E) sequentially, i.e. no holes in between each task.

The number of question in 1st table is fixed

Once the agent filled out all the risk question, he will press a button and
the macro or VBS will do the rest, filling the contingency table for him.

Can somebody help me start that project ?