# Excel formula

Hello,

I need a formula to populate "tab1" with all data in all rows from "tab2" if that row's cell "total" equals "abc".

Thanks in advance for any tips.
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
I don't think a formula will work for you
you need to use VBA and or an autofilter
here is some pseduo code that would work in VBA

public sub MoveData

dim dblRow as double
dim dblTarget as double

do until thisworkbook.sheets(2).range("A" & dblRow).value = ""
if thisworkbook.sheets(2).range("C" & dblRow).value = "abc" then
' Copy the data
thisworkbook.sheets(2).rows(dblRow & ":" & dblRow).copy thisworkbook.sheets(1).range("A" & dblTarget)
end if
dblRow = dblRow+1
loop

end sub

happy coding
0
Author Commented:
Thanks for the answer.  To elaborate, I need to copy all row data on "Sheet3" if cell C of that row equals "\$0".  I need this row data to copy to "Sheet4"

Thanks.
0
Commented:
crash1624,
Your new request seems quite different from the first. Is it supposedly the same?
The first request isn't easily understood because one may have a hard time finding "that row's cell "total"". The second request shouldn't be difficult. Place this formula in Sheet3!A2:-
``````=IF(Sheet4!\$C2,"",Sheet4!A2)
``````
=IF(Sheet4!\$C2,"",Sheet4!A2)
Copy to the right for as many columns as you wish to copy, then copy down for as many rows you have in Sheet4.
Of course, this will give you blank rows which you can filter out.
0

Experts Exchange Solution brought to you by