LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Making a msgbox return a value in one cell, when data is searched and found in another. TIA


Thank you for helping me with this in advance. I'm grateful for all
the help I've found in these groups.

I'm running a macro that is searching a sheet for data. When it finds
that data, I need a msgbox to pop up with the data from that column's
top cell.

I have it searching the sheet and finding the data listed in the
search.

Because of the possibility of multiple winners, the msgbox will pop up
each time someone scores.

This macro works fine as it is except I would like to add the winners
names to the message boxes.

thanks again,
JasonK


With Worksheets(1).Range("A4:AF54")
Dim mySearch As String
Dim winner As String
Dim myReplaceValue
mySearch = InputBox("Name? ")
myReplaceValue = InputBox("Score value? ")
Set c = .Find(mySearch, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Offset(, 1) = myReplaceValue
c.Offset.Interior.ColorIndex = 1
c.Offset(, 1).Interior.ColorIndex = 1
c.Offset(, -1).Interior.ColorIndex = 1
c.Offset(, -1) = "X"
c.Offset(, -1).Font.Bold = True
c.Offset.Font.ColorIndex = 2
c.Offset(, 1).Font.ColorIndex = 2
c.Offset(, -1).Font.ColorIndex = 2

msgbox TOP VALUE IN COLUMN " scored."



Set c = .FindNext(c)
Count = Count + 1
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to return the address of a cell found via VLOOKUP? artisdepartis Excel Programming 3 July 6th 07 10:54 AM
Return Column of Found Data Sprinks Excel Programming 2 June 27th 07 03:54 PM
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
vlookup to return the cell positioning where the criteria is found Rock Excel Programming 2 March 12th 05 03:42 PM
VBA: Return Searched Value Inputed by End-User Mcasteel Excel Worksheet Functions 1 October 28th 04 03:09 PM


All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"