Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Proper syntex to use jannie Excel Discussion (Misc queries) 1 February 10th 10 08:26 PM
Syntex Error ?? Paul Cooke Excel Discussion (Misc queries) 4 December 9th 05 01:54 PM
Date format within a text syntex? Brw Excel Worksheet Functions 2 January 26th 05 02:13 PM
Multiple column listbox syntex question Martha[_2_] Excel Programming 2 May 7th 04 10:24 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"