Hi,
I have a long list of varied data.
I have some data where an O or I character may or may not appear.
If it does appear is always the one between the 3rd and 4th space that is of interest for me.
If it does appear I want the O or I to be deleted leaving just a single space.
O and I can appear at other positions in the string so I cannot use a blanket replace method.
I am moving up through the data line by line and would be grateful if anybody could suggest a VBA routine to do this.
Some example data is shown below. The characters in bold are the ones I would like to delete leaving just a single space at the same point.
Speed is not critical for me.
Many thanks for any suggestions.
DRILL
String
Section
MD
(ft)
Yield Strength
(psi)
VME Stress
(psi)
Absolute Safety Factors
Triaxial Burst Collapse Axial
1 1 4431.1 115000.0 48045.5 D 2.394 100+ 23.676 2.571
2 1 4460.9 115000.0 47964.7 D 2.398 100+ 23.541 2.577
3 2 4461.1 O 115000.0 38214.3 D O 3.009 I 5.220 O 3.209 C 2.577
4 2 4560.8 O 115000.0 38560.8 D O 2.982 I 5.105 O 3.144 C 2.613
5 2 4561.0 O 115000.0 38561.5 D O 2.982 I 5.105 O 3.144 C 2.614
6 2 4587.8 O 115000.0 38655.6 D O 2.975 I 5.075 O 3.127 C 2.624
7 2 4588.0 I 115000.0 38656.4 D O 2.975 I 5.075 O 3.127 C 2.624
8 2 4800.8 I 115000.0 39421.6 D O 2.917 I 4.850 I 2.998 C 2.706
9 2 4801.0 I 115000.0 39422.3 D O 2.917 I 4.850 O 2.998 C 2.706
I have a long list of varied data.
I have some data where an O or I character may or may not appear.
If it does appear is always the one between the 3rd and 4th space that is of interest for me.
If it does appear I want the O or I to be deleted leaving just a single space.
O and I can appear at other positions in the string so I cannot use a blanket replace method.
I am moving up through the data line by line and would be grateful if anybody could suggest a VBA routine to do this.
Some example data is shown below. The characters in bold are the ones I would like to delete leaving just a single space at the same point.
Speed is not critical for me.
Many thanks for any suggestions.
DRILL
String
Section
MD
(ft)
Yield Strength
(psi)
VME Stress
(psi)
Absolute Safety Factors
Triaxial Burst Collapse Axial
1 1 4431.1 115000.0 48045.5 D 2.394 100+ 23.676 2.571
2 1 4460.9 115000.0 47964.7 D 2.398 100+ 23.541 2.577
3 2 4461.1 O 115000.0 38214.3 D O 3.009 I 5.220 O 3.209 C 2.577
4 2 4560.8 O 115000.0 38560.8 D O 2.982 I 5.105 O 3.144 C 2.613
5 2 4561.0 O 115000.0 38561.5 D O 2.982 I 5.105 O 3.144 C 2.614
6 2 4587.8 O 115000.0 38655.6 D O 2.975 I 5.075 O 3.127 C 2.624
7 2 4588.0 I 115000.0 38656.4 D O 2.975 I 5.075 O 3.127 C 2.624
8 2 4800.8 I 115000.0 39421.6 D O 2.917 I 4.850 I 2.998 C 2.706
9 2 4801.0 I 115000.0 39422.3 D O 2.917 I 4.850 O 2.998 C 2.706