Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default checked the equal values from cells


that I can checked the equal values from cells two different worksheets

example

sheet1
A1= -10,01
A2= -10,01
A3=10,00
A4=10,02
A5=10,06


sheet2
A1= -10,01
A3=-10,00
A4=10,03
A6=10,06
A7= -10,01


request

sheet1
A1= -10,01 ok
A5=10,06 οκ

sheet2
A1= -10,01 ok
A6=10,06 οκ

thank you
kar


--
kar
------------------------------------------------------------------------
kar's Profile: http://www.excelforum.com/member.php...o&userid=33922
View this thread: http://www.excelforum.com/showthread...hreadid=536996

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default checked the equal values from cells


There's probably a more efficient way to do this, but this is one way t
do it:

Sub Test()
Dim iTotalSheet1Rows As Integer
Dim iTotalSheet2Rows As Integer
iTotalSheet1Rows = Sheets("Sheet1").UsedRange.Rows.Count
iTotalSheet2Rows = Sheets("Sheet2").UsedRange.Rows.Count

For iRow = 1 To iTotalSheet1Rows
For iRow2 = 1 To iTotalSheet2Rows
If Sheets("Sheet1").Cells(iRow, 1).Value
Sheets("Sheet2").Cells(iRow2, 1).Value Then
Sheets("Sheet1").Cells(iRow, 2).Value = "OK"
Sheets("Sheet2").Cells(iRow2, 2).Value = "OK"
iRow2 = iTotalSheet2Rows
End If
Next iRow2
Next iRow

For iCount = 1 To iTotalSheet1Rows
For iCount2 = iCount + 1 To iTotalSheet1Rows
If Sheets("Sheet1").Cells(iCount, 1).Value
Sheets("Sheet1").Cells(iCount2, 1).Value Then
Sheets("Sheet1").Cells(iCount2, 2).Value = ""
End If
Next iCount2
Next iCount

For iCount3 = 1 To iTotalSheet2Rows
For iCount4 = iCount3 + 1 To iTotalSheet2Rows
If Sheets("Sheet2").Cells(iCount3, 1).Value
Sheets("Sheet2").Cells(iCount4, 1).Value Then
Sheets("Sheet2").Cells(iCount4, 2).Value = ""
End If
Next iCount4
Next iCount3
End Sub

kar Wrote:
that I can checked the equal values from cells two different worksheets

example

sheet1
A1= -10,01
A2= -10,01
A3=10,00
A4=10,02
A5=10,06


sheet2
A1= -10,01
A3=-10,00
A4=10,03
A6=10,06
A7= -10,01


request

sheet1
A1= -10,01 ok
A5=10,06 οκ

sheet2
A1= -10,01 ok
A6=10,06 οκ

thank you
ka


--
Ikaabo
-----------------------------------------------------------------------
Ikaabod's Profile: http://www.excelforum.com/member.php...fo&userid=3337
View this thread: http://www.excelforum.com/showthread.php?threadid=53699

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
VBA: Matching cells across columns, and returning equal values Babymech Excel Discussion (Misc queries) 0 January 26th 09 04:41 PM
Formula to find equal values with blank cells hilltop55 Excel Discussion (Misc queries) 5 March 22nd 07 09:12 PM
Setting varible to equal values of a # of cells mozart[_8_] Excel Programming 6 April 15th 06 11:32 PM
string values do not equal cells, then return msg Kevin O'Neill[_2_] Excel Programming 2 December 14th 05 09:38 PM
lineup equal values by inserting empty cells uffe1909 Excel Discussion (Misc queries) 2 September 21st 05 01:39 PM


All times are GMT +1. The time now is 08:34 PM.

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

About Us

"It's about Microsoft Excel"