Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a data sheet that looks something like this, with about 100,000
rows: A B C D E F 1 5 3 5 3 2 9 5 4 3 5 3 From this data sheet I would like to extract the data point in column F, anytime this criteria is met: "A" = 5, "B"=3, and "C"=4 The mastersheet I am bringing data to (the sheet running the macro), needs to keep track of the current cell and only move after a datapoint is pulled. I have coded in other languages, but almost not at all in basic. Here is the rough pseudo code I have drawn up, but I don't know the actual function names to do this stuff and am having a hard time looking it up (I keep running across ways to change the "Active" cell, but I don't think I can use that in this case): Dim i = 2 '// The current row in the data sheet - Sheet2 Dim J = 2 '// The current row in the master sheet - Sheet1 If (i<100,000) then if(Sheet2.Cell(A,i)="5" && Sheet2.Cell(B,i)="3" && Sheet2.Cell(C,4)="4") then Sheet1.Cell(A,J) = Sheet2.Cell(F,i) J = J+1 '// Move 1 row down on the master sheet because we had a positive match End If i = i+1 End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
converting formulas to code | New Users to Excel | |||
converting cell formulaes to code | Excel Worksheet Functions | |||
Converting EasyLanguage code to Excel | Excel Discussion (Misc queries) | |||
Help converting code to late binding | Excel Programming | |||
Help Converting Cell Formula To VBA Code | Excel Programming |