Newbie in VBA - Help to find value if two other conditions are met

Jexis

New Member
Joined
Mar 1, 2016
Messages
2
Hi All,

Well I am a complete newbie on VBA and am learning on the go at the moment. I do have a "little" issue that I cannot figure out:

So I have a workbook containing quite a lot of formulas already (these are working fine) but there's one last bit I cannot seem to resolve.

The sheet is as follows (please note this is just partial data):

Management:6

<tbody>
</tbody>
Management:7

<tbody>
</tbody>
ACCOUNT_NAME

<tbody>
</tbody>
ORG 6 Update

<tbody>
</tbody>
Corp Code

<tbody>
</tbody>
Account Type

<tbody>
</tbody>
Account Number

<tbody>
</tbody>
12345678

<tbody>
</tbody>
12345678- Account Name 1

<tbody>
</tbody>
Account Name 1-
ABC123

<tbody>
</tbody>
CORPORATE

<tbody>
</tbody>
12345678

<tbody>
</tbody>
87654321

<tbody>
</tbody>
87654321 - Account Name 2

<tbody>
</tbody>
Account Name 2

<tbody>
</tbody>
-
ABC123

<tbody>
</tbody>
ACCOUNT

<tbody>
</tbody>
87654321

<tbody>
</tbody>
9876543298765432 - Account Name 3Account Name 3-DEF456CORPORATE98765432
2345678923456789 - Account Name 4Account Name 4-DEF456ACCOUNT23456789

<tbody>
</tbody>

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>


Column A and G have the same value for now, column B is a concatenate of G and C. What should happen is following: Column A should reflect the account number of of the Corporate account type if the Corp Code is the same. I cannot figure out how to make this going (there are about 600 lines with multiple Corp Codes, Account Types and Account Numbers). Which is why I turn to you as you have been helpful to me creating this file so far (loving the forum!)

Please help my poor brain with this problem :)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Column A should reflect the account number of of the Corporate account type if the Corp Code is the same.

what does this mean ? show us a desired output table
 
Upvote 0
Column A should reflect the account number of of the Corporate account type if the Corp Code is the same.

what does this mean ? show us a desired output table

Hey Oldbrewer,

Sorry if I wasn't clear :(

So the desired output should be:

Management:6
Management:7ACCOUNT_NAMEORG 6 UpdateCorp Code
Account Type
Account Number
1234567812345678- Account Name 1Account Name 1 -ABC123CORPORATE12345678
1234567887654321 - Account Name 2Account Name 2-ABC123ACCOUNT87654321
98765432
98765432 - Account Name 3Account Name 3-DEF456CORPORATE98765432
9876543223456789 - Account Name 4Account Name 4-DEF456ACCOUNT 23456789

<tbody>
</tbody>


















I hope that the additional table helps making it clear! If not, I'll try to write it down again in other terms.

Thanks again!
 
Upvote 0
say in words what information you seek and where you want it

I cannot see where row 2 of your output comes from
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,267
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top