Results 1 to 2 of 2

Message Box Populating Wrong Amount of Data

Threaded View

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Mumbai
    MS-Off Ver
    Excel 2003
    Posts
    51

    Message Box Populating Wrong Amount of Data

    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
    Last edited by Leith Ross; 08-29-2013 at 01:22 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Large amount of data on clipboard message
    By Bezzie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-14-2013, 05:14 AM
  2. Replies: 3
    Last Post: 09-02-2009, 03:22 PM
  3. Pop-up message of total amount
    By macroDummy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2007, 03:03 AM
  4. error message 91 when entering wrong data
    By eyesonly1965 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2006, 11:22 AM
  5. [SOLVED] SUMPRODUCT is showing wrong Amount
    By msbutton27 in forum Excel General
    Replies: 2
    Last Post: 01-25-2006, 11:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1