Hi all,
I would like to seek help for comparing the number in sheet1 whether available in sheet2. If sheet1 got the number in sheet2, it will highlight in sheet1 .Please refer my attachment. Thanks. hope to hear from you soon.
Hi all,
I would like to seek help for comparing the number in sheet1 whether available in sheet2. If sheet1 got the number in sheet2, it will highlight in sheet1 .Please refer my attachment. Thanks. hope to hear from you soon.
See attached. USed Named range and Conditional formatting.
Hi,
I not understand used name range and conditional format? Can u please explain. Thanks
Select cells B6 to B10 and look at name box (leftmost dropdown list type, where normally cell address is shown) in the Original Data sheet. "list" name will appear
Go to next sheet and select B2, then Format\Conditional formatting, you will see the formula.
Hi,
How about i want to do coding for comparing same number? Can u show me?
I want to click the button and it's start comparing the same number between 2 sheet. Thanks
Last edited by apple; 08-04-2007 at 12:37 AM.
Try this:
-------------------------------------------------
The more details you give, the easier it is to understand your question. Don't save the effort, tell us twice rather than not at all. The amount of info you give strongly influences the quality of answer, and also how fast you get it.
Hi Jimmy,
Thanks for your help. Have a nice day. Cheers
Hi Jimmy,
Please do explain the code in red font.
For Each c In Data.Cells
Set Hit = plm.Find(c.Value, , xlValues, xlWhole, , , False)
If Not Hit Is Nothing Then c.EntireRow.Interior.ColorIndex = 3
Next
End Sub
Thanks. Hope you have a nice day.
It is looking for the value in the cell pointed to by the c variable within the range of cells pointed to by plm, and returning a range object, Hit, with the found cell.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Hi,
How about the comma in blue font between Set Hit = plm.Find(c.Value, , xlValues, xlWhole, , , False). What is the comma means?
Just means it is skipping that value. Look at Find in VBA help.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Hi,
Can anyone help me as below question:
Question 1:
I want to highlight the number for 11 digit (XXXXX-XXXXX) in length as i highlighted in red colour. Please refer my attachment. Please teach me how to achieve that.Thanks
Last edited by apple; 08-08-2007 at 06:09 AM.
[VBA] For Each c In Original_List.Cells
Set Hit = Compare_List.Find(c.Value, , xlValues, xlWhole, , , False)
If Not Hit Is Nothing Then
Dim Test
If InStr(1, Hit, "-") > 0 Then
Test = Split(Hit, "-")
If Len(Test(0)) = 5 And Len(Test(1)) = 5 Then
c.Interior.ColorIndex = 3
End If
End If
End If
Next[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Hi,
Thanks for your help.
Can you explain the syntax as below in red font:
For Each c In Original_List.Cells
Set Hit = Compare_List.Find(c.Value, , xlValues, xlWhole, , , False)
If Not Hit Is Nothing Then
Dim Test
If InStr(1, Hit, "-") > 0 Then
Test = Split(Hit, "-")
If Len(Test(0)) = 5 And Len(Test(1)) = 5 Then
c.Interior.ColorIndex = 3
End If
End If
End If
Next
Dim Test
declares a variable (wastefully as it does it every iteration of the loop)
If InStr(1, Hit, "-") > 0 Then
checks if the variable Hit contains a dash
Test = Split(Hit, "-")
and if so, it splits Hit into an array of values delimited by dash
If Len(Test(0)) = 5 And Len(Test(1)) = 5 Then
If the first or second item in that array is 5 characters
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
You could also just test if Instr(Hit, "-") = 6 and len(Hit) = 11
Regards,
Rory
Microsoft MVP - Excel
Hi AppleOriginally Posted by apple
You should check the Help file first and come back with any particular clarification you require.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Noted. Thanks