Replicating values in fields based upon other records

tebbr

New Member
Joined
Oct 30, 2014
Messages
5
I'm importing a text file for analysis and am looking for a way to value a field in a record based upon the value in the previous row of the report.

The report looks like this

Account Sub Account
1234 ABDF
FHGI
STUV
4239 NUPD
DRVG


I'm looking to populate the 1234 on the records that contain FHGI and STUV and the 4239 with the DRVG, etc.

IS there a quick way to do this while importing the file into access?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I'm importing a text file for analysis and am looking for a way to value a field in a record based upon the value in the previous row of the report.

The report looks like this

Account Sub Account
1234 ABDF
FHGI
STUV
4239 NUPD
DRVG


I'm looking to populate the 1234 on the records that contain FHGI and STUV and the 4239 with the DRVG, etc.

IS there a quick way to do this while importing the file into access?

Looks Like I lost the formatting when submitting the post....Re applied
 
Upvote 0
I keep losing the formatting The report has the Numeric values in the first column and all of the Alpha values in the second column. I would like to have the numeric values repeated for each alpha value. So each row of the table would contain a Numeric followed by an also value

1234 ABDF
1234 FHGI
1234 STUV
4239 NUPD
4239 DRVG
 
Upvote 0
You will need to use VBA code to loop through the records and write the data to the desired table.
 
Upvote 0

Forum statistics

Threads
1,221,893
Messages
6,162,662
Members
451,781
Latest member
DylantheD

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