LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Comparing Cell values in two sheets within the same workbook

This is the code i have.

i want to compare a range of values in column H in sheet 1 with a
column that is in the sheet called 'mis tool'

I have the code looping down the range in sheet 1 and comparing to the
1st value in sheet 'mis tool', once the range in sheet 1 has run
throught, the cell selected in 'mis tool' will move down 1 and then it
will re-check for similar values.

the problem i have is that i can't get the code to pick up on entries
that are equal to each other.

I need an if statement that can compare the selected cell in sheet 1
with the selected cell in sheet 'mis tool', all cells are numerical
entries

the code as it is stops at the first IF statement, but otherwise does
what i need it to do.

any ideas?

Sub Macro1()

Sheets("Sheet1").Select
Range("H2").Select
Sheets("mis tool").Select
Range("F2").Select
Sheets("Sheet1").Select
Do
Do While ActiveCell < 0
If ActiveCell = Sheets("mis tool").ActiveCell Then
Sheets("mis tool").Select
ActiveCell.Offset(0, 3).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
ActiveCell.Offset(0, 13).Select
ActiveSheet.Paste
ElseIf ActiveCell < Sheets("mis tool").ActiveCell Then
Sheets("Sheet1").Select
ActiveCell.Offset(1, 0).Select
End If
Loop
If ActiveCell = 0 Then
Sheets("Sheet1").Select
Range("H2").Select
Sheets("mis tool").Select
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell = 0
End Sub

 
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
comparing values from one workbook with another workbook dpdave Excel Discussion (Misc queries) 3 February 10th 10 04:55 PM
comparing values on different sheets and deleting np Excel Discussion (Misc queries) 1 December 10th 09 04:56 PM
Comparing data in two sheets with similar values Darshan Excel Worksheet Functions 4 December 6th 07 05:42 PM
comparing 2 similar columns on seperate work sheets in 1 workbook Dan Excel Discussion (Misc queries) 4 September 20th 05 11:58 PM
Comparing cell values Touk Excel Programming 3 September 29th 04 11:04 AM


All times are GMT +1. The time now is 06:01 AM.

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"