Grabbing specific info from poorly organized worksheets

tcorbs

New Member
Joined
May 17, 2011
Messages
9
So here's what I want to do. I am trying to create a macro that would compile all the claim numbers (strings) and check amounts from the various source tabs into a list in the "ClaimList" tab. However, I want to add the check amounts for duplicate claim numbers (like a pivot table).

Part of the issue is that the "claim #" column consists of a claim number, then anywhere from 1-4 empty rows, then another claim number, and so on to the end. Fortunately, there are only check amounts in the rows where there is a claim number. Furthermore, the "claim #" column varies from source to source, as does the column for check amount. However, the columns are both always titled, and the column titles are always in row 4.

What is the most efficient way to do this? I set out to do it on my own, but I don't know enough VBA to do it in a reasonable amount of time. Furthermore, it would probably be a very poor algorithm, and I'd rather use something more efficient. I have the tabs set up in excel as follows:

'ClaimList', 'Source_1', 'Source_2', 'Source_3', etc.

Thanks
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Yeah, I looked at the multiple ranges thing. I need to be able to rerun this macro immediately after adding another 'Source' tab. And without altering it

For example, if at first I had a single source tab that looked like this:

Excel Workbook
ABCDEFGHIJKLM
4Payee NameFull AddressMail to AddressCK AmountOvernight mail (y/n)Insured NameDecription of ClaimPolicy #Claim #Policy Eff DatePolicy Exp DateDate of LossIf 1099 Reportable list tax id #
511/2/2010************
6HOMER123 EVERGREEN TERR.SAME12.00* NOHOMERLEG FRACTURE234-2341234-19/29/109/29/1110/20/10* NA
7*************
8*************
9BART126 EVERGREEN TERR.SAME7.00NOBARTPNEUMONIA234-2351235-010/26/0910/26/1010/6/10*NA
10LISA127 EVERGREEN TERR.SAME4.00NOLISAPNEUMONIA234-2361235-1****
11*************
12MAGGIE129 EVERGREEN TERR.SAME4.00NOMAGGIEJOINT ILLNESS235234-541236-03/18/103/18/1110/6/10NA
13*************
14MARGE131 EVERGREEN TERR.SAME2.00NOMARGESPINAL INJURY3453-3451237-05/27/105/27/1110/6/10NA
15*************
16HOMER123 EVERGREEN TERR.SAME6.00NOHOMERSINUS ILLNESS3453-3451235-21/20/101/20/1110/13/10NA
Source_1


Then I would want my output to be this:

Excel Workbook
ABC
3Claim #Cum. CK AmountChange
41234-112.00* * * * * * * *12.00
51235-07.00* * * * * * * * *7.00
61235-14.00* * * * * * * * *4.00
71236-04.00* * * * * * * * *4.00
81237-02.00* * * * * * * * *2.00
91235-26.00* * * * * * * * *6.00
ClaimList


I didn't mention the "Change" column before, but ultimately this will show the change after adding another 'Source' tab. So, then I would add another tab titled Source_2, with the necessary data in (possibly) different columns:


Excel Workbook
ABCDEFGHIJKL
4Payee NameFull AddressMail to AddressOvernight mail (y/n)Insured NameDecription of ClaimPolicy #Claim #Policy Eff DatePolicy Exp DateDate of LossCK Amount
511/2/2010***********
6HOMER123 EVERGREEN TERR.SAME* NOHOMERLEG FRACTURE234-2341234-19/29/109/29/1110/20/108.00
7************
8************
9BART126 EVERGREEN TERR.SAMENOBARTPNEUMONIA234-2352235-010/26/0910/26/1010/6/106.00
10LISA127 EVERGREEN TERR.SAMENOLISAPNEUMONIA234-2362235-1***3.00
11************
12MAGGIE129 EVERGREEN TERR.SAMENOMAGGIEJOINT ILLNESS235234-541238-03/18/103/18/1110/6/105.00
13************
14MARGE131 EVERGREEN TERR.SAMENOMARGESPINAL INJURY3453-3451239-05/27/105/27/1110/6/108.00
15************
16HOMER123 EVERGREEN TERR.SAMENOHOMERSINUS ILLNESS3453-3451235-21/20/101/20/1110/13/104.00
Source_2


I would rerun the macro and my output would be this:


Excel Workbook
ABC
3Claim #Cum. CK AmountChange
41234-120.00* * * * * * * * *8.00
51235-07.00* * * * * * * * * * - *
61235-14.00* * * * * * * * * * - *
71236-04.00* * * * * * * * * * - *
81237-02.00* * * * * * * * * * - *
91235-210.00* * * * * * * * *4.00
102235-06.00* * * * * * * * *6.00
112235-13.00* * * * * * * * *3.00
121238-05.00* * * * * * * * *5.00
131239-08.00* * * * * * * * *8.00
ClaimList


Thanks
 
Upvote 0
Day 2 bump. Feel like there should be some relatively short VBA code for this macro. Please let me know if this is not the case, or if my example is not sufficient. Thanks.
 
Upvote 0
Sorry to bump this again, but it looks like maybe the "New posts" board gets cleared at 9 a.m. I did not know this.
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,555
Members
452,928
Latest member
101blockchains

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