vba to change the length of cell then converting the file into text

vinod9111

Active Member
Joined
Jan 21, 2009
Messages
426
Hi All,

I have to report account level data to regulator, they have described certain norms on the data submission. The data has to be in 25 fields , each field has its length and it should be in text format.

I need a macro firstly to check the length of each field as given below in case of error it should highlight the cell number where it is not inputted as per the requirement. There are certain fields which needs to be kept blank, which is mentioned in the remarks column. The data size is huge and to do this task manually takes lot of time.

Once the length of data is okay it has to be converted in text file with the length give below, against the blank field there should be number of space as given in the length, data format has to be text except for two fields as given in data format.

Hope i make sense, any help will be appreciated

FieldsLengthRemarksData format
Job_Code2 Text
Month_2 Text
Year_4 Text
FillerI1BlankText
BSR_CODE_PART_I7 Text
FillerII1BlankText
pag_no4BlankText
sr_no4BlankText
FCL1 Text
dist code3 Text
population grp_Code1 Text
type of acct2 Text
org code2 Text
occupation5 Text
nature of borrw acct2 Text
asset class1 Text
Secured/Unsecured Loan code1 Text
Fixed/Floating interest Flag1 Text
BANK RATE14 Text
AMTFIN_roundoff10 Number
POS_roundoff10 Number
Lot_no4 Text
Colan1 Text
Unique ID20 Text
Semi colan1 Text

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

regards
Vinod
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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