Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm using excel 2007 and 2003. I have a routine to loop trough *.txt files in a folder and search for string in a single line. All was fine until I had to, based on found value, take all lines from this value to top, e.g. When I find a line marked with specyfic marker ("in this case "NC") I have to take all values from over this value until I reach empty line (so looping backwards), then I continue searching. Code samples (below function to copy data to specyfic cells) Function move_all(LineofText, k) Cells(k, "a") = Mid(LineofText, 2, 2)'Here if Mid(LineofText, 2, 2) = "NC" 'macro should go back and pull all data until it reaches empty line. Cells(k, "b") = Mid(LineofText, 6, 8) Cells(k, "c") = CLng(Mid(LineofText, 17, 10)) Cells(k, "d") = Str(Mid(LineofText, 29, 15)) Cells(k, "e") = CStr(Mid(LineofText, 46, 38)) Cells(k, "f") = CStr(Mid(LineofText, 86, 4)) Cells(k, "g") = Mid(LineofText, 91, 18) Cells(k, "h") = Trim(Mid(LineofText, 100, 20)) Cells(k, "i") = Mid(LineofText, 125, 8) Cells(k, "a").Activate End Function Thanks in advance for help Regards Piotr |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Not able to read dates accross bottom of chart | Charts and Charting in Excel | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) | |||
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. | Charts and Charting in Excel |