excel_beginer
New Member
- Joined
- Dec 28, 2017
- Messages
- 19
hello all
I have excel file with 3 sheets: Main, A and B (A,B: sheets have data of balance_sheets). So I want to check data in A,B right or wrong with conditions:
1. For each cell i (i from 2 to 15000) in sheets(A) and sheets(B)
If sheets(A)!Bi = sheets(B)!Bi and sheets(A)!Ci = sheets(B)!Ci and sheets(A)!Di = sheets(B)!Di => do nothing
else if copy row i from sheets(B) to sheets("main").
2. For each row in sheets(A) and sheets(B) I want to check data that:
if left(Ai;1) = "1" or "2" or "4" or "7" or "8" check that Ci + Ei - Fi = Gi and Di + Fi - Ei = Hi => if right do nothing but if wrong copy row i to sheets("main") in last row
if left(Ai;1) = "3" or "5" or "6" check that (Ci - Di) + (Ei - Fi) = (Gi - Hi) => if right do nothing but if wrong copy row i to sheets("main") in last row
if left(Ai;1) = "9" check that Ci + Di - Ei = Fi => if right do nothing but if wrong copy row i to sheets("main") in last row
So can you help me do 1. and 2. above to check data by code VBA?
Many thanks./.
I have excel file with 3 sheets: Main, A and B (A,B: sheets have data of balance_sheets). So I want to check data in A,B right or wrong with conditions:
1. For each cell i (i from 2 to 15000) in sheets(A) and sheets(B)
If sheets(A)!Bi = sheets(B)!Bi and sheets(A)!Ci = sheets(B)!Ci and sheets(A)!Di = sheets(B)!Di => do nothing
else if copy row i from sheets(B) to sheets("main").
2. For each row in sheets(A) and sheets(B) I want to check data that:
if left(Ai;1) = "1" or "2" or "4" or "7" or "8" check that Ci + Ei - Fi = Gi and Di + Fi - Ei = Hi => if right do nothing but if wrong copy row i to sheets("main") in last row
if left(Ai;1) = "3" or "5" or "6" check that (Ci - Di) + (Ei - Fi) = (Gi - Hi) => if right do nothing but if wrong copy row i to sheets("main") in last row
if left(Ai;1) = "9" check that Ci + Di - Ei = Fi => if right do nothing but if wrong copy row i to sheets("main") in last row
So can you help me do 1. and 2. above to check data by code VBA?
Many thanks./.