Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message Box data from cells

Status
Not open for further replies.

jlroeder

Technical User
Sep 18, 2009
91
US
I have been working on this for two days and I am at a loss. I am trying to have a message box popup with 5 different cells. My data filter is working correctly and I am doing all my countif statments on sheet 2 of my workbook. I tried to write a code to have my message box countif, but it wasn't working. So now I just did a simple formula on sheet 2 to list everything I am counting. Now I am trying to popup a message box with the cell values A1 through B5 displaying my information. Column A is my information name and column B is my countif data.
 
Hi,

It's not clear where your problem resides.

Is it getting the box to pop up or getting the message into the box?
 
Im going to abandon the use of column A and just try to have the information from B . My code is

MsgBox "Count of Work Orders:" & worksheet.("Numbers").cell("B1") vbnewline _
MsgBox "Count of Trouble Calls:" & worksheet.("Number").cell("B2") vbnewline _
Msgbox "User 1 Orders:" & worksheet.("Numbers").cell("B3") vbnewline _
Msgbox "User 2 Orders:" & worksheet.("Numbers").cell("B4") vbnewline _
Msgbox "User 3 Orders:" & worksheet.("Numbers").cell("B5")


I'm using a =COUNTIF('Main Query'!D:D,"SR")in my sheet2 to pull my numbers.

I tried to do
Msgbox "Count of Work Orders:" & worksheet.("Numbers").countif('Main Query'!D:D,"SR")
to try and do this with no formulas.
 
Is that what you are after....?

Code:
Dim str As String

str = "Count of Work Orders: " & worksheet.("Numbers").cell("B1") & vbnewline _
    & "Count of Trouble Calls: " & worksheet.("Number").cell("B2") & vbnewline _
    & "User 1 Orders: " & worksheet.("Numbers").cell("B3") & vbnewline _
    & "User 2 Orders: " & worksheet.("Numbers").cell("B4") & vbnewline _
    & "User 3 Orders: " & worksheet.("Numbers").cell("B5")

MsgBox str

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top