Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to match/compare cell values


how do i compare/match cell value from worksheet 1 with 4 cell values
from worksheet 2?

please help, thank you.


--
tandavina
------------------------------------------------------------------------
tandavina's Profile: http://www.excelforum.com/member.php...o&userid=30334
View this thread: http://www.excelforum.com/showthread...hreadid=499997

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default how to match/compare cell values

I'm sure it could be done using formulas directly in the Excel workbook
but I usually use VBA. Something like this could be used to compare 1
name entered in the first cell of Sheet 1 to 4 names entered into the
first 4 cells of column A in Sheet 2 . . .

Sub findMatch()
Dim myName As String
Dim findName As Variant
Dim loopCounter As Integer
myName = Sheets("Sheet1").Range("A1").Value
findName = Sheets("Sheet2").Range("A1:A4")
For loopCounter = 1 To 4
If myName = findName(loopCounter, 1) Then
MsgBox "Match Found! Hello " & myName
End If
Next loopCounter
End Sub

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 and match names and extract a cell content dexsourcesys Excel Worksheet Functions 1 January 19th 06 07:51 PM
Compare cell values Grant Excel Worksheet Functions 5 February 24th 05 10:54 AM
How do i compare values from two sheet and copy & paste if values match? rozb Excel Programming 0 March 5th 04 12:06 AM
compare two cell values on different sheets sagarh Excel Programming 3 February 16th 04 01:42 PM


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