Hi Friend,
I have a query regards to below mentioned code.. I have a list of 100 people, when i run below mentioned code its shows only 73 people list instead of 100... Can anyone help me out in this... Please
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim targetstring
targetstring = Target.Address
If InStr(targetstring, "C") = 0 Then Exit Sub
Dim Alltext As String
Dim findforme As String
findforme = ActiveCell.Offset(0, -1).Value
MsgBox findforme
Dim oSht As Worksheet
Dim lastRow As Long, i As Long
Set oSht = Sheets("INFO-Pune")
lastRow = oSht.Range("C" & Rows.Count).End(xlUp).Row
For i = 1 To lastRow
If oSht.Range("C" & i).Value = findforme Then
Alltext = Alltext & vbNewLine & oSht.Range("C" & i).Offset(0, -2).Value & " - " & oSht.Range("C" & i).Value
End If
Next i
MsgBox Alltext
End Sub
Regards,
Hari
Bookmarks