with hello and regards two all members and administrators
i have this table
COUNTRY1 EXPORT$ COUNTRY2 IMPORT$ SAME CODE EXPORT$ IMPORT$ 30% MINOR
10190 117 10190 294
10210 74 10210 138
10290 16 10290 29
10511 27 10511 11
10519 127 10519 70
10639 127 10639 47
10690 19 10690 47
… … … …
… … … …
… … … …
961700 19 961700 18
961800 558 961800 1
970110 970 970110 27
970190 116 970190 3
970500 0 970500 3
970600 0 970600 91,969
Column A: Country1 Export Code
Column B: Export value for Country 1
Column C: Country2 Import Code
Column D: Import value for Country 2
------------------- NOW ---------------------
i want to fill in Column E to H with a macro
Column E: same code in Column A and Column C
Column F: export value for same code (from Column B)
Column G: import value for same code (from Column D)
Column H: 30 percent of Minor Value
for example if F3 is 9000 and G3 is 1000 then H3 will be 2700 that is 30 percent of F3
thanks a lot for your attention
sincerely
amin
Last edited by VBA Noob; 04-25-2009 at 03:33 PM.
a better post here
with hello and regards two all members and Mr. Excel
i have this table
A B C D E F G H
COUNTRY1 EXPORT$ COUNTRY2 IMPORT$ SAME CODE EXPORT$ IMPORT$ 30% MINOR
10190 117 10190 294
10210 74 10210 138
10290 16 10290 29
10511 27 10511 11
10519 127 10519 70
10639 127 10639 47
10690 19 10690 47
… … … …
… … … …
… … … …
961700 19 961700 18
961800 558 961800 1
970110 970 970110 27
970190 116 970190 3
970500 0 970500 3
970600 0 970600 91,969
Column A: Country1 Export Code
Column B: Export value for Country 1
Column C: Country2 Import Code
Column D: Import value for Country 2
excel 2003 file
http://www.4shared.com/account/file/...brAl6Snyxwpbv0
excel 2007 file
http://www.4shared.com/account/file/...brAl6Snyxwpbv0
NOW
i want to fill in Column E to H with a macro
Column E: same code in Column A and Column C
Column F: export value for same code (from Column B)
Column G: import value for same code (from Column D)
Column H: 30 percent of Minor Value
for example if F3 is 9000 and G3 is 1000 then H3 will be 2700 that is 30 percent of F3
thanks a lot for your attention
sincerely
amin
why a macro,? functions will do as you require, given your example and layout
IN E2 =A2
IN F2 =B2
IN G2 = D2
IN H2 =IF(F2<=G2,F2*30%,G2*30%)
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
sorry for incorrect post. the correct table is here with approximately 120000 rows:
A B C D E F G H
COUNTRY1 EXPORT$ COUNTRY2 IMPORT$ SAME CODE EXPORT$ IMPORT$ 30% MINOR
10190 117 10190 294
10212 74 10210 138
10290 16 10215 29
10511 27 10210 11
10639 127 10210 70
10890 127 10639 47
11141 19 10890 47
… … … …
… … … …
… … … …
961800 19 961700 18
970110 558 961800 1
986730 970 970110 27
986730 116 970190 3
995040 0 970500 3
995040 0 970600 91,969
I have duplicate cells within A and C columns and different codes between them. some codes are in A that is not in C and viceversa
i do not want to comparing A and c columns in same rows. i want to
1- comparing this A and C columns,
2- extracting same codes of A and C in column E
3- fill F and G columns with B and D values of Joint A and C codes
4- computing 30 percent of major value in B and D in column H
sincerely
amin
With Special Thanks to All members
i correct my last past
i have this table with approximately 120000 rows:
A B C D E F G H
COUNTRY1 EXPORT$ COUNTRY2 IMPORT$ SAME CODE EXPORT$ IMPORT$ 30% MINOR
10190 117 10190 294
10212 74 10210 138
10290 16 10215 29
10511 27 10210 11
10639 127 10210 70
10890 127 10639 47
11141 19 10890 47
… … … …
… … … …
… … … …
961800 19 961700 18
970110 558 961800 1
986730 970 970110 27
986730 116 970190 3
995040 0 970500 3
995040 0 970600 91,969
this table has duplicate cells within A and C columns and some codes are different between A and C (some codes are in A that is not in C and viceversa)
i want to:
1- comparing this A and C columns,
2- extracting same codes of A and C in column E
3- fill F and G columns with B and D values of Joint A and C codes
4- computing x (for example 30) percent of major value in B and D in column H
sincerely
amin
Threads merged.
Please continue in the same thread.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Please post a link to your cross-posts on other Excel forums.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
after running macro 1 to 3 rows for E to H columns will be such as this:
A B C D E F G H
COUNTRY1 EXPORT$ COUNTRY2 IMPORT$ SAME CODE EXPORT$ IMPORT$ 30% MINOR
10190 117 10185 294 10190 117 138 35.1
10210 74 10190 138 10210 74 11 3.3
10290 16 10210 11 10639 50 47 5.4
10639 27 10212 70 … … … …
10639 23 10213 18 … … … …
10890 127 10639 47 … … … …
11141 19 10721 52 … … … …
thanks a lot, please help
Amin,
Second request: Please read the forum rules, and then post a link to every other Excel forum where you have posted the same question.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
hi man
i correct my last post, because i fill in column A to H
i only have a problem i want to solve it
what do you thinks?!
Your thread is being closed for non compliance with our rules. Please PM me when you have read the forum rules RULES and made the changes to your post accordingly, i will then unlock your post so you may continue with the thread!
Post Closed
VBA Noob
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks