I am trying to display the row & column number in a MsgBox. Therefore, my MsgBox should display something like:
MsgBox "Apple is in cell A1"
I am trying to display the row & column number in a MsgBox. Therefore, my MsgBox should display something like:
MsgBox "Apple is in cell A1"
Last edited by Astroboy142; 12-02-2009 at 07:28 PM.
Is the message box reporting details of the activecell? If not what cell should be reported.
activecell
A1 of activesheet![]()
Msgbox activecell.value & " is in cell " & activecell.address
![]()
Msgbox Range("A1").value & " is in cell " & Range("A1").address
My macro is in Sheet2 and finds a value from Sheet1 and stores it in Result.
Therefore,
I want a message box stating
MsgBox Result & " is in cell" & ______________
here's a copy of my code:
If WorksheetFunction.CountIf(Sheets("Schedule; Jan-Jun").Range("Data"), "S") > 0 Then
With Sheets("Schedule; Jan-Jun").Range("Data")
vOurResult = .Find(What:="S", After:=.Cells(1, 1), _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
End With
MsgBox vOurResult & " is in Cell" &
End If
End Sub
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
If you make the returned variable a range object then you will have the information you need.![]()
dim rngOurResult as range set rngOurResult = .Find(What:="S", After:=.Cells(1, 1), _ LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False) if not rngOurResult is nothing then MsgBox vOurResult.value & " is in cell " & vOurResult.address else Msgbox "Nothing found" end if
Thanks for the help! I had to tweak it a bit but it worked out. Sorry about not staying in compliance with the Forum rules. I'm a newbie to the whole forum deal. I will try to follow the "rules"
Thanks for the help. I hope I added the "solve" correctly
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks