View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Finding a specific cell value on different sheet

This version will leave the found cell activated:

Sub looper()
Set sh1 = Sheets("Sheet1")
Set sh2 = Sheets("Sheet2")
ad = ActiveCell.Address
v = ActiveCell.Value
For i = 2 To 1000
If v = sh1.Cells(i, "C").Value Then
sh1.Cells(i, "C").Font.FontStyle = "Bold"
sh1.Activate
Cells(i, "C").Select
Exit For
End If
Next
sh2.Range(ad).Interior.ColorIndex = 3
End Sub
--
Gary''s Student - gsnu200818


"Looping through" wrote:

Thanks Gary, this work's great.

How can I activate the cell in sheet 1 instead of just making it bold. I
just realized I need to insert some text in an adjascent cell.

I would like the entire row selected, offeset 11 cells over and insert the
word Lost.

"Gary''s Student" wrote:

Sub looper()
Set sh1 = Sheets("Sheet1")
Set sh2 = Sheets("Sheet2")
ad = ActiveCell.Address
v = ActiveCell.Value
For i = 2 To 1000
If v = sh1.Cells(i, "C").Value Then
sh1.Cells(i, "C").Font.FontStyle = "Bold"
Exit For
End If
Next
sh2.Range(ad).Interior.ColorIndex = 3
End Sub
--
Gary''s Student - gsnu200818