Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default If for word in sentence

Try this (assuming A14 would not start with "Information:" when there is the
extra phrase)

If Left(Range("A14"),11)=" Information" Then
Do Something
Else
Do Something Else
End if
--
If this helps, please remember to click yes.


"Graham H" wrote:

I download various files from a site which are all the same format starting as shown
below. The first row is always blank. The column A cells below this row all have text data
which can be made up of several words making up a phrase or sentence. All wihout fail
start with the word Information. There are two types of file one which has 12 rows
starting with this word and those which have 13. Where there are 13 the extra phrase is
the one shown in A8 which is the only one phrase I have shown in its entirety. There is a
lot of data after row 14 but it is not relevant for this exercise. What I need to do in
code is tio identify whether we have a file with the 12 rows starting with information or
thirteen ie

if (rows 2 to 14 start with the word information) then
do this
else

I hope this makes sense as I would value any guidance on the best way to do this when the
word is the start of a phrase or sentence.


A1 Blank row
A2 Information: This is the Field Data etc
A3 Information: To upload this file etc
A4 Information: You MUST NOT change the etc
A5 Information: Every line of data MUST start with '' etc
A6 Information: The entries for etc
A7 Information: 'Area Eligible for LFASS 2009' is only applicable for Permanent land.
A8 Information: For non LFA land do not enter a value in the column 'Area Eligible for
LFASS 2009'.

A9 Information: Ensure that a blank line etc
A10 Information: Always use the code list etc
A11 Information: Always save this file before uploading (as a .CSV file) etc
A12 Information: You MUST start a new sheet etc
A13 Information: These details are for etc
A14 Information:
A15
A16
etc

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default If for word in sentence

Absolutely perfect Paul, works fine and is nice and tidy. Many thanks.

Graham

Paul C wrote:
Try this (assuming A14 would not start with "Information:" when there is the
extra phrase)

If Left(Range("A14"),11)=" Information" Then
Do Something
Else
Do Something Else
End if

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
Find in a sentence diferent word Carpe Diem Excel Worksheet Functions 1 July 14th 11 02:33 PM
Find a word in a sentence Chicago2Paris Excel Worksheet Functions 10 October 29th 09 06:29 PM
Link a cell to a word in a sentence Brenelder Excel Discussion (Misc queries) 1 March 14th 08 08:36 PM
how to keep a word of same sentence starting w a capital next lin dottie Excel Worksheet Functions 1 September 20th 07 05:32 PM
How do I highlight a word or sentence within Excel? cands Excel Discussion (Misc queries) 1 October 11th 05 10:58 PM


All times are GMT +1. The time now is 01:11 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"