Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default VBA search and compare strings

I have an Excel spreasheet and in worksheet_1 I have a word in each cell from E2 to H51. On worksheet_2 I have a column of cells each with two words in them. I am trying to write a VBA macro that says; if a word from range E2:H26 and a word from range E27:H51 is in a cell in worsheet_2 then write a "No" in the next column in workshhet_2 but on the same row, else write a "Yes".

Many thanks for any help.

Stuart
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default VBA search and compare strings

Hi Stuart
why not use a worksheet formula. e.g. in B1 on sheet 2 enter
=IF(COUNTIF('sheet1'!$E$2:$H$51,"*" & A1 & "*"),"No","Yes")

--
Regards
Frank Kabel
Frankfurt, Germany


stuart wrote:
I have an Excel spreasheet and in worksheet_1 I have a word in each
cell from E2 to H51. On worksheet_2 I have a column of cells each
with two words in them. I am trying to write a VBA macro that says;
if a word from range E2:H26 and a word from range E27:H51 is in a
cell in worsheet_2 then write a "No" in the next column in
workshhet_2 but on the same row, else write a "Yes".

Many thanks for any help.

Stuart

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
Compare Strings dksaluki Excel Discussion (Misc queries) 4 October 18th 08 09:39 PM
Compare two strings andy62 Excel Worksheet Functions 8 September 6th 06 02:14 PM
Compare the strings yangyh Excel Discussion (Misc queries) 3 September 8th 05 04:45 AM
Search for strings David494 New Users to Excel 6 August 1st 05 01:05 PM
How to compare only a PART of strings? Marty Excel Programming 2 June 9th 04 11:26 PM


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