Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What syntex to find text
Hi
What I'm trying to do is: Automate the opening of three .TXT files into Excel, format the data, moving columns, changing fonts etc.. in each file, ready to place into a single file to sort, filter, delete and add formulas etc.. That's the part I can handle. Problem is the three .TXT files I receive named OUTPUT1.TXT OUTPUT2.TXT & OUTPUT3.TXT do not always contain the same information i.e. OUTPUT1 may contain students D.O.Birth, next time OUTPUT2 will contain D.O.Birth. The reports are generated elsewhere so I do not have control of their filenames. But in each the cell A2 has text indicating part of the files content. My problem is after opening any of the OUTPUT files, how do I check if cell A2 contains " list with date of birth " within it's contents and if TRUE rename the file to Output1.txt. Also should A2 contain " list of school card " Then rename the sheet tab to Output2.txt or should A2 contains " list of atsi students " rename the sheet tab to Output3.txt? What is the syntex to search/find a short string of text, say 15 char. in a cell containing a longer 100 char string? Can the text search/find be non_case_sensitive? Sorry for this second post on same subject but I received a message saying my reply to Otto Moehrbach got lost in system. -- Thank you Regards Bob C Using Windows XP Home + Office 2003 Pro |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
What syntex to find text
sStr1 =" list with date of birth "
sStr2 =" list of school card " sStr3 =" list of atsi students " sStr = Range("A2").Text Select Case True Case instr(1,sStr,sStr1,vbTextCompare) 0 ActiveSheet.Name = "Output1.txt" Case instr(1,sStr,sStr2,vbTextCompare) 0 ActiveSheet.Name = "Output2.txt" Case instr(1,sStr,sStr3,vbTextCompare) 0 ActiveSheet.Name = "Output3.txt" End Select -- Regards, Tom Ogilvy "Robert Christie" wrote in message ... Hi What I'm trying to do is: Automate the opening of three .TXT files into Excel, format the data, moving columns, changing fonts etc.. in each file, ready to place into a single file to sort, filter, delete and add formulas etc.. That's the part I can handle. Problem is the three .TXT files I receive named OUTPUT1.TXT OUTPUT2.TXT & OUTPUT3.TXT do not always contain the same information i.e. OUTPUT1 may contain students D.O.Birth, next time OUTPUT2 will contain D.O.Birth. The reports are generated elsewhere so I do not have control of their filenames. But in each the cell A2 has text indicating part of the files content. My problem is after opening any of the OUTPUT files, how do I check if cell A2 contains " list with date of birth " within it's contents and if TRUE rename the file to Output1.txt. Also should A2 contain " list of school card " Then rename the sheet tab to Output2.txt or should A2 contains " list of atsi students " rename the sheet tab to Output3.txt? What is the syntex to search/find a short string of text, say 15 char. in a cell containing a longer 100 char string? Can the text search/find be non_case_sensitive? Sorry for this second post on same subject but I received a message saying my reply to Otto Moehrbach got lost in system. -- Thank you Regards Bob C Using Windows XP Home + Office 2003 Pro |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
What syntex to find text
Once again Tom a very big thankyou
Regards Aussie Bob C. "Tom Ogilvy" wrote: sStr1 =" list with date of birth " sStr2 =" list of school card " sStr3 =" list of atsi students " sStr = Range("A2").Text Select Case True Case instr(1,sStr,sStr1,vbTextCompare) 0 ActiveSheet.Name = "Output1.txt" Case instr(1,sStr,sStr2,vbTextCompare) 0 ActiveSheet.Name = "Output2.txt" Case instr(1,sStr,sStr3,vbTextCompare) 0 ActiveSheet.Name = "Output3.txt" End Select -- Regards, Tom Ogilvy "Robert Christie" wrote in message ... Hi What I'm trying to do is: Automate the opening of three .TXT files into Excel, format the data, moving columns, changing fonts etc.. in each file, ready to place into a single file to sort, filter, delete and add formulas etc.. That's the part I can handle. Problem is the three .TXT files I receive named OUTPUT1.TXT OUTPUT2.TXT & OUTPUT3.TXT do not always contain the same information i.e. OUTPUT1 may contain students D.O.Birth, next time OUTPUT2 will contain D.O.Birth. The reports are generated elsewhere so I do not have control of their filenames. But in each the cell A2 has text indicating part of the files content. My problem is after opening any of the OUTPUT files, how do I check if cell A2 contains " list with date of birth " within it's contents and if TRUE rename the file to Output1.txt. Also should A2 contain " list of school card " Then rename the sheet tab to Output2.txt or should A2 contains " list of atsi students " rename the sheet tab to Output3.txt? What is the syntex to search/find a short string of text, say 15 char. in a cell containing a longer 100 char string? Can the text search/find be non_case_sensitive? Sorry for this second post on same subject but I received a message saying my reply to Otto Moehrbach got lost in system. -- Thank you Regards Bob C Using Windows XP Home + Office 2003 Pro |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Proper syntex to use | Excel Discussion (Misc queries) | |||
Syntex Error ?? | Excel Discussion (Misc queries) | |||
Date format within a text syntex? | Excel Worksheet Functions | |||
Multiple column listbox syntex question | Excel Programming | |||
backwards find function to find character in a string of text | Excel Programming |