Extracting numbers and data

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,563
Office Version
  1. 2021
Platform
  1. Windows
I have a spreadsheet containing account numbers in Col F and value in column H

I would like VBA to extract the account numbers from Audit Trail Sample (Source Workbook) and to copy these in the respoective sheets as follows in the destinatination workbook

A) sheet 2215B

1) Where 2215B appears in Col F, I want the number above 2215B including 2215B to be extracted as well as the values two columns to the right of it, excluding the following numbers in Col F 6900, 1102, 2310, 2311, 2316, 2200 and the values one column to the right i.e col H
2) Once the numbers and values have been extracted to sheet 2215B, I want the values the are directly above 2215B added and multiplied by 0.14 to ensure that this agrees with the value two columns to the right of 2215B i.e in Col H-I have manually extracted some data to show you what is required
3) Where 2218B appears in Col F, this account and the accounts and values two columns to the right and directly above it are to be ignored
4) Where 2215S appears one row above 2215B , then this can be ignored i.e 2215B and 2215S directly above it not to be extracted

B) Sheet 2215S

Where 2215S appears in Col F, I want the number above 2215S including 2215S to be extracted as well as the values two columns to the right of it, excluding the following numbers in Col F 6900, 1102, 2310, 2311, 2316, 2200
2) Once the numbers and values have been extracted to sheet 2215B, I want the values that are directly above 2215S added and multiplied by 0.14 to ensure that this agrees with the value in 2215B-I have manually extracted some data to show you what is required
3) Where 2218S appears in Col F, this account and the accounts and values two columns to the right and directly above to be ignored

See Aduit trail extraction sample of what I extracted manually to give you an idea of what is required

Your assistance in this regard is most appreciated

http://windowssecrets.com/forums/sh...tracting-numbers-and-data?p=858239#post858239


Audit Trail Sample.xls
FGHI
1690024775.69
21102-24775.7
322448864.951908.922
41102-10106
579582689.75
61102-3066.32
77958680.68
81102-775.98
97940474.14
101102-540.52
117940462.82
121102-527.62
137940462.82
141102-527.62
15220037.57
161102-37.57
172215B1908.92
18
19220025640.64
202311-25640.6
212200657.45
226913-576.71
232215S-80.74
Sheet1



Audit Trail Sample.xls
FGHI
451113M-1726
461111F662
471113F-662
4811122615
491111F-2615
501113F672
511112-672
521113M694
531111M-694
541112500
551113F-500
561113F570
571111F-570
582218B0
592218S0
60
61693088000
622215B12320
632311-100320
Sheet1


Audit trail Extraction.Sample.xls
ABCD
122448864.95
279582689.75
37958680.68
47940474.14
57940462.82
67940462.82
7
82215B1908.92
9
10Check1908.92
11
12Variance0
2215B


Audit trail Extraction.Sample.xls
ABCD
16913-576.71
22215S-80.74
3
4Check-80.74
5
6Variance0
7
8
2215S
 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

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