I am in need of help to write a macro for importing data from a txt file automatically, and to separate the data into multiple columns by a specific cell input. The only problem is that my txt file imports as a single column and the data isn't exact same amount of rows. So I would like the VBA or Macro to loop to find a specific text and take all the information below it, until it reaches the next cell with a similar name in it. Here's what the data looks like (mind you it's 21000 rows) at a glance. The specific cell criteria is the first cell and 125 lines down is the next similar one.
<colgroup><col></colgroup><tbody>
</tbody>
[Magazine0_Pot001] |
Pot_Kind=0 |
PTN=0 |
FTN=0 |
ITN=0 |
Order=0 |
Note= |
Through_Spindle_Enable=0 |
Through_Spindle_Time=0 |
ATC_Speed=0 |
M60_Disable=0 |
Prohibit=0 |
TL_Alarm_Effective=0 |
Total_Cutter=1 |
Pot_Size=0 |
Prohibit_Rotation=0 |
Empty_Pot=0 |
Irregular_Shape=0 |
Commanded_T_Code=0 |
TLS_Search=0 |
B_Axis_Rot_Prohibit=0 |
One_Touch_Prohibit=0 |
RakuRakuL_Measuring=0 |
Tool_Size=0 |
TSC_Removal_Type=0 |
ExistOnMgz=0 |
CheckH=0 |
CheckD=0 |
InspectedFlag=0 |
ONumber1=0 |
ONumber2=0 |
ONumber3=0 |
TSC_Frequency=0 |
TSC_FLOW_CHECK=1 |
TSC_Frequency_Setting=0 |
AngleHeadDistance_X=0 |
AngleHeadDistance_Y=0 |
AngleHeadDistance_Z=0 |
AngleHeadVector_X=0 |
AngleHeadVector_Y=0 |
AngleHeadVector_Z=0 |
PWRFLR_Retract_Disable=0 |
SisterToolStatus=0 |
TLMgzVibCtrlMode=0 |
UseTlsNo=0 |
MultiPurpose=0 |
AirSpinDataNO=0 |
ImagingAtTCode=0 |
FixedPot=0 |
GroupNo=0 |
ImagingAllTogether=0 |
ImagExist=0 |
SchankCount=0 |
HighAccuracySeatChk=0 |
SpinVibRapidW=0 |
SpinVibRapidA=0 |
SpinVibCutW=0 |
SpinVibCutA=0 |
TSC_Pressure=0 |
AlarmStopType=0 |
Helix=0 |
C1_Kind=0 |
C1_H_Geometry=0 |
C1_H_Wear=0 |
C1_D_Geometry=0 |
C1_D_Wear=0 |
C1_TL_Time_Enable=0 |
C1_TL_Time_Alarm=0 |
C1_TL_Time Warn=0 |
C1_TL_Time Actual=0 |
C1_TL_Distance_Enable=0 |
C1_TL_Distance_Alarm=0 |
C1_TL_Distance_Warn=0 |
C1_TL_Distance_Actual=0 |
C1_TL_Count_Enable=0 |
C1_TL_Count_Alarm=0 |
C1_TL_Count_Warn=0 |
C1_TL_Count_Actual=0 |
C1_SL_Upper=0 |
C1_SL_Lower=0 |
C1_AC=0 |
C1_Alarm=0 |
C1_Warning=0 |
C1_BTS_Enable=0 |
C1_BTS_Action_Type=0 |
C1_BTS_Before=0 |
C1_BTS_After=0 |
C1_BTS_Length=0 |
C1_Operator_Call=0 |
C1_First_Use=0 |
C1_Spindle_Speed_M6=0 |
C1_Coolant_Kind_M6=0 |
C1_Spindle_Speed_Limit=0 |
C1_Surface_Speed_Limit=0 |
C1_SuspendAlarm=0 |
C1_SuspendWarning=0 |
C1_H_Standard=0 |
C1_Number_Blade=1 |
C1_R_Geometry=0 |
C1_R_Wear=0 |
C1_Radial_Max_Load=0 |
C1_Axial_Max_Load=0 |
C1_Inst_Spd_AST4=0 |
C1_Shift_Spd_AST4=0 |
C1_ImagingDataBefore=0 |
C1_ImagingDataAfter=0 |
C1_Max_Load=0 |
C1_Ave_Load=0 |
C1_Min_Load=0 |
C1_Max_Vibration1=0 |
C1_Ave_Vibration1=0 |
C1_Min_Vibration1=0 |
C1_Max_Vibration2=0 |
C1_Ave_Vibration2=0 |
C1_Min_Vibration2=0 |
C1_Max_Vibration3=0 |
C1_Ave_Vibration3=0 |
C1_Min_Vibration3=0 |
C1_Inst_Spd_AST4_2=0 |
C1_Shift_Spd_AST4_2=0 |
C1_Inst_Spd_AST4_3=0 |
C1_Shift_Spd_AST4_3=0 |
C1_CutType=0 |
C1_Turning_SL_Upper=0 |
C1_Turning_SL_Lower=0 |
[Magazine0_Pot002] |
Pot_Kind=0 |
PTN=0 |
FTN=0 |
ITN=0 |
Order=0 |
Note= |
Through_Spindle_Enable=0 |
Through_Spindle_Time=0 |
ATC_Speed=0 |
M60_Disable=0 |
Prohibit=0 |
TL_Alarm_Effective=0 |
Total_Cutter=1 |
Pot_Size=0 |
Prohibit_Rotation=0 |
Empty_Pot=0 |
Irregular_Shape=0 |
Commanded_T_Code=0 |
TLS_Search=0 |
B_Axis_Rot_Prohibit=0 |
One_Touch_Prohibit=0 |
RakuRakuL_Measuring=0 |
Tool_Size=0 |
TSC_Removal_Type=0 |
ExistOnMgz=0 |
CheckH=0 |
CheckD=0 |
InspectedFlag=0 |
ONumber1=0 |
ONumber2=0 |
ONumber3=0 |
TSC_Frequency=0 |
TSC_FLOW_CHECK=1 |
TSC_Frequency_Setting=0 |
AngleHeadDistance_X=0 |
AngleHeadDistance_Y=0 |
AngleHeadDistance_Z=0 |
AngleHeadVector_X=0 |
AngleHeadVector_Y=0 |
AngleHeadVector_Z=0 |
PWRFLR_Retract_Disable=0 |
SisterToolStatus=0 |
TLMgzVibCtrlMode=0 |
UseTlsNo=0 |
MultiPurpose=0 |
AirSpinDataNO=0 |
ImagingAtTCode=0 |
FixedPot=0 |
GroupNo=0 |
ImagingAllTogether=0 |
ImagExist=0 |
SchankCount=0 |
HighAccuracySeatChk=0 |
SpinVibRapidW=0 |
SpinVibRapidA=0 |
SpinVibCutW=0 |
SpinVibCutA=0 |
TSC_Pressure=0 |
AlarmStopType=0 |
Helix=0 |
C1_Kind=0 |
C1_H_Geometry=0 |
C1_H_Wear=0 |
C1_D_Geometry=0 |
C1_D_Wear=0 |
C1_TL_Time_Enable=0 |
C1_TL_Time_Alarm=0 |
C1_TL_Time Warn=0 |
C1_TL_Time Actual=0 |
C1_TL_Distance_Enable=0 |
C1_TL_Distance_Alarm=0 |
C1_TL_Distance_Warn=0 |
C1_TL_Distance_Actual=0 |
C1_TL_Count_Enable=0 |
C1_TL_Count_Alarm=0 |
C1_TL_Count_Warn=0 |
C1_TL_Count_Actual=0 |
C1_SL_Upper=0 |
C1_SL_Lower=0 |
C1_AC=0 |
C1_Alarm=0 |
C1_Warning=0 |
C1_BTS_Enable=0 |
C1_BTS_Action_Type=0 |
C1_BTS_Before=0 |
C1_BTS_After=0 |
C1_BTS_Length=0 |
C1_Operator_Call=0 |
C1_First_Use=0 |
C1_Spindle_Speed_M6=0 |
C1_Coolant_Kind_M6=0 |
C1_Spindle_Speed_Limit=0 |
C1_Surface_Speed_Limit=0 |
C1_SuspendAlarm=0 |
C1_SuspendWarning=0 |
C1_H_Standard=0 |
C1_Number_Blade=1 |
C1_R_Geometry=0 |
C1_R_Wear=0 |
C1_Radial_Max_Load=0 |
C1_Axial_Max_Load=0 |
C1_Inst_Spd_AST4=0 |
C1_Shift_Spd_AST4=0 |
C1_ImagingDataBefore=0 |
C1_ImagingDataAfter=0 |
C1_Max_Load=0 |
C1_Ave_Load=0 |
C1_Min_Load=0 |
C1_Max_Vibration1=0 |
C1_Ave_Vibration1=0 |
C1_Min_Vibration1=0 |
C1_Max_Vibration2=0 |
C1_Ave_Vibration2=0 |
C1_Min_Vibration2=0 |
C1_Max_Vibration3=0 |
C1_Ave_Vibration3=0 |
C1_Min_Vibration3=0 |
C1_Inst_Spd_AST4_2=0 |
C1_Shift_Spd_AST4_2=0 |
C1_Inst_Spd_AST4_3=0 |
C1_Shift_Spd_AST4_3=0 |
C1_CutType=0 |
C1_Turning_SL_Upper=0 |
C1_Turning_SL_Lower=0 |
<colgroup><col></colgroup><tbody>
</tbody>