Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-21-2012, 06:18 PM
macropod's Avatar
macropod macropod is offline show a cell Windows 7 64bit show a cell Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use something like:
Code:
Sub GetAddresses()
Dim i As Long, j As Long, Rng As Range
With ThisWorkbook.Worksheets("Data")
  j = .Range("A" & .Rows.Count).End(xlUp).Row
  For i = 2 To j
    Set Rng = ThisWorkbook.Worksheets("Report").Cells.Find(what:=.Cells(i, 2).Value, LookIn:=xlValues, _
      LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True)
    If Rng Is Nothing Then
      .Cells(i, 5).Value = ""
    Else
      .Cells(i, 5).Value = Split(Rng.Address, "$")(1)
    End If
  Next
End With
End Sub
If you want the address of the matched cell, change 'Split(Rng.Address, "$")(1)' to 'Rng.Address'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I create a formula that will show result in the same cell and let me copy it down CranstC Excel 1 02-11-2012 01:29 AM
How can I delete the content of a cell in column if the cell value is more than 1000? Learner7 Excel 2 06-27-2011 05:44 AM
Question: Hyperlink to other show, but close the current show habibfikri PowerPoint 0 12-26-2010 02:37 AM
How can I fill cell color starting from Cell D5 using Conditional formatting instead Learner7 Excel 0 07-08-2010 05:50 AM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft