Use of the "find" or "if" function in VBA

0

Please help with the following problem:

I have a .txt file to be formatted in EXCEL, and a data separation has to be done, data and line numbers may vary in size.

The logic would be more or less this:

If the cell text is ("case1") Select everything from "case1" until you find "!". Copy selected cells. create a new worksheet Paste copied cells.

What is the best function to use?

Ex of the txt file.

  

test! ! ! ! % case1   BR139 :: x3537.23y367.48: N230 :: x4075.42y358.09: 305 :::: S1: Automatic: 384.499862 < 359 # 153.770629 < 359 # ::::::: x3921.67y360.77:   E720 :: x1473.88y687.96: ETIFSC :: x1473.88y723.46: 40 :::: S1: Automatic :::::::::   E900 :: x2043.13y621.36: E901 :: x2070.13y621.36: 0 :::: S1: Automatic :::::::::   E901 :: x2070.13y621.36: N110 :: x2198.13y621.36: 50 :::: S1: Automatic :::::::::   E917 :: x1014.67y625.43: E918 :: x1038.67y625.43: 0 :::: S1: Automatic :::::::::   E918 :: x1038.67y625.43: N40 :: x1179.67y625.43: 50 :::: S1: Automatic :::::::::   E924 :: x1474.41y753.96: E925 :: x1474.41y794.18: 0 :::: S1: Automatic :::::::::   ! % case2   BR139 :: x3537.23y367.48: N230 :: x4075.42y358.09: 305 :::: S1: Automatic: 384.499862 < 359 # 153.770629 < 359 # ::::::: x3921.67y360.77:   E720 :: x1473.88y687.96: ETIFSC :: x1473.88y723.46: 40 :::: S1: Automatic :::::::::   E900 :: x2043.13y621.36: E901 :: x2070.13y621.36: 0 :::: S1: Automatic :::::::::   E901 :: x2070.13y621.36: N110 :: x2198.13y621.36: 50 :::: S1: Automatic :::::::::   E917 :: x1014.67y625.43: E918 :: x1038.67y625.43: 0 :::: S1: Automatic :::::::::   E918 :: x1038.67y625.43: N40 :: x1179.67y625.43: 50 :::: S1: Automatic :::::::::   E924 :: x1474.41y753.96: E925 :: x1474.41y794.18: 0 :::: S1: Automatic :::::::::

Thank you

    
asked by anonymous 01.10.2018 / 16:21

0 answers