Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default searching in visual basic

I am fairly new to writing in visual basic and I need some help. I have 3
columns of data to "side one" of a worksheet and then a seperate 3 columns on
"side two" of the same worksheet. The two sides are simply seperated by a
couple columns. I need to compare the two sides to find matches. I do not
need it to find matches on the same side of data just from one side to the
other. If there are matches I need for the cell to change to an orange
background.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default searching in visual basic

Use Conditional Formatting found under the format menu (in xl2003 and
earlier).

for the conditional formatting formula
Use countif to determine if there is a match. So this would be the basis:

=countif($AA:$AC,A1)

Look in the conditional formatting sections at Debra Dalgleish's site.

http://www.contextures.com/tiptech.html


--
Regards,
Tom Ogilvy


"gatech steph" wrote:

I am fairly new to writing in visual basic and I need some help. I have 3
columns of data to "side one" of a worksheet and then a seperate 3 columns on
"side two" of the same worksheet. The two sides are simply seperated by a
couple columns. I need to compare the two sides to find matches. I do not
need it to find matches on the same side of data just from one side to the
other. If there are matches I need for the cell to change to an orange
background.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default searching in visual basic

To the Original Poster,
Just to add that Match works with a single column or single row. If by 3
columns of data you mean you have multiple rows, Match may not be the best
choice.

--
Regards,
Tom Ogilvy


"Don Guillett" wrote:

You can just use conditional formatting
formatconditional formatformula istype in something like thisformat as
desired.
=IF(MATCH(F7,$A$7:$C$7),TRUE)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"gatech steph" <gatech
wrote in message
...
I am fairly new to writing in visual basic and I need some help. I have 3
columns of data to "side one" of a worksheet and then a seperate 3 columns
on
"side two" of the same worksheet. The two sides are simply seperated by a
couple columns. I need to compare the two sides to find matches. I do not
need it to find matches on the same side of data just from one side to the
other. If there are matches I need for the cell to change to an orange
background.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default searching in visual basic

I don't think this will work for what I am trying to do. Is there a way to
post a picture so I can show a screen shot of what I am trying to explain??

"Don Guillett" wrote:

You can just use conditional formatting
formatconditional formatformula istype in something like thisformat as
desired.
=IF(MATCH(F7,$A$7:$C$7),TRUE)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"gatech steph" <gatech
wrote in message
...
I am fairly new to writing in visual basic and I need some help. I have 3
columns of data to "side one" of a worksheet and then a seperate 3 columns
on
"side two" of the same worksheet. The two sides are simply seperated by a
couple columns. I need to compare the two sides to find matches. I do not
need it to find matches on the same side of data just from one side to the
other. If there are matches I need for the cell to change to an orange
background.





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default searching in visual basic

Ok that some what worked for what I need but I have some blank cells in
between sets of rows that are being considered as match. Is there a way to
avoid this becuase I do not want these cells to be highlighted.

"Tom Ogilvy" wrote:

Use Conditional Formatting found under the format menu (in xl2003 and
earlier).

for the conditional formatting formula
Use countif to determine if there is a match. So this would be the basis:

=countif($AA:$AC,A1)

Look in the conditional formatting sections at Debra Dalgleish's site.

http://www.contextures.com/tiptech.html


--
Regards,
Tom Ogilvy


"gatech steph" wrote:

I am fairly new to writing in visual basic and I need some help. I have 3
columns of data to "side one" of a worksheet and then a seperate 3 columns on
"side two" of the same worksheet. The two sides are simply seperated by a
couple columns. I need to compare the two sides to find matches. I do not
need it to find matches on the same side of data just from one side to the
other. If there are matches I need for the cell to change to an orange
background.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default searching in visual basic

Just check that condition

=if(A1="",False,countif( . . . ))

--
Regards,
Tom Ogilvy



"gatech steph" wrote:

Ok that some what worked for what I need but I have some blank cells in
between sets of rows that are being considered as match. Is there a way to
avoid this becuase I do not want these cells to be highlighted.

"Tom Ogilvy" wrote:

Use Conditional Formatting found under the format menu (in xl2003 and
earlier).

for the conditional formatting formula
Use countif to determine if there is a match. So this would be the basis:

=countif($AA:$AC,A1)

Look in the conditional formatting sections at Debra Dalgleish's site.

http://www.contextures.com/tiptech.html


--
Regards,
Tom Ogilvy


"gatech steph" wrote:

I am fairly new to writing in visual basic and I need some help. I have 3
columns of data to "side one" of a worksheet and then a seperate 3 columns on
"side two" of the same worksheet. The two sides are simply seperated by a
couple columns. I need to compare the two sides to find matches. I do not
need it to find matches on the same side of data just from one side to the
other. If there are matches I need for the cell to change to an orange
background.

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
Is Visual Basic the same as Visual Studio 2008? Mike Stewart Excel Worksheet Functions 5 January 11th 09 04:58 PM
Programmatic access to visual basic project via Visual FoxPro Jim Rech Excel Programming 0 January 11th 07 01:53 PM
Make visual basic truely visual! GraphicalGuy Excel Programming 0 October 20th 06 05:53 PM
Can I run Visual Basic procedure using Excel Visual Basic editor? john.jacobs71[_2_] Excel Programming 3 December 26th 05 02:22 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM


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