HELP me PLZ

KOK

Board Regular
Joined
Aug 9, 2010
Messages
115
Hello All,
I require help for the following question :
I have data in Sheet1, Row 1,which contains unique data , and this data
scattered in Sheet2, which is also unique.
Now, on Sheet1 , on Row2, I want the address of cell where the cell can
be found in Sheet2.
For eg. On Sheet1 Cell A1 - contains value - 100, and it can be found on
Sheet2 at c55, now I want this cell reference on Sheet1, B1.

Thanks in Advance..!!:biggrin:
 
Try this:-
Code:
Sub FindUniques ()
Application.ScreenUpdating = False
Dim i as Long
Dim FoundCell as Object
On Error Resume Next
With Sheets("Sheet1")
For i = 1 to .cells(1, Columns.Count).End(xlToLeft).Column
  FoundCell = Sheets("Sheet2").Cells.Find(what:=.cells(1,i))  
  If FoundCell Is Nothing Then
    .cells(2,i) = "Value not found"
  Else
    .cells(2,i) = FoundCell.Address
  End If
Next i
End With
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
When you say it's not working, are you getting error messages?
Is it doing anything?
What happens if you step through the code?
 
Upvote 0
Hi --

I do not get any error messages...but I see that evenif the value could be found in sheet2, the result shows "Value not found"

Thanks in Advance
 
Upvote 0
OK. Replace this line:-
FoundCell = Sheets("Sheet2").Cells.Find(what:=.cells(1,i))

with this one:-
Set FoundCell = Sheets("Sheet2").Cells.Find(what:=.cells(1,i))
 
Upvote 0
Hi – if I modify this question as following then will I get the answer ?
Data is in the range “B2:H10” (Sheet1)
Data where to search “C9:S600” (Sheet2)
And the result should be on range “B12:H20” (Sheet1)
Thanks in advance…:confused:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
 
Upvote 0
Try this (untested).
Code:
Sub FindUniques ()
Application.ScreenUpdating = False
Dim i as Long,rng as Range, FoundCell as Object
for each rng in range("B2:H10")
  On Error Resume Next
  With Sheets("Sheet1")
  Set FoundCell = Sheets("Sheet2").Range("C9:S600").Find(what:=rng.value)  
  If FoundCell Is Nothing Then
    rng.offset(10,10) = "Value not found"
  Else
    rng.offset(10,10) = FoundCell.Address
  End If
Next rng
End With
Application.ScreenUpdating = True
End Sub
 
Upvote 0
I faced error on Next statement, It said Compile Error : Next Without For

Thanks:biggrin:
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,691
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top