Message box to show cell value

  • Thread starter Thread starter scottwilsonx
  • Start date Start date
S

scottwilsonx

Hi all, hope you can help.
I am running a set of macros to analyse and provide summar
calculations on a selected data range.

The totals are displayed in row 20, with A20 showing "Total", B20 th
count, C20 an average and D20 the count x average.

What I would like to do is, at the end of the macros, to create anothe
macro that shows a message box showing B20, C20 and D20.

Firstly, is this possible ? and if so, can you show (in the sam
message box) the values of B20, C20 and D20 together ?!

All help gratefully received.

Thanks
Scott
 
The totals are displayed in row 20, with A20 showing "Total", B20 the
count, C20 an average and D20 the count x average.

What I would like to do is, at the end of the macros, to create another
macro that shows a message box showing B20, C20 and D20.

Firstly, is this possible ? and if so, can you show (in the same
message box) the values of B20, C20 and D20 together ?!

dim msg as string
dim t as long

msg = "Stats"+chr$(13)+chr$(13) 'chr$(13) is a carriage return

with sheets("Sheet1") 'or whatever your sheet is
msg = msg + "Count : " + format( .range("B20").value) + chr$(13)
msg = msg + "Average : " + format( .range("C20").value) + chr$(13)
msg = msg + "Count/Avg : " + format( .range("D20").value)
end with

t = msgbox( msg, vbInformation)


Iain King
 
Iain, many thanks for the post.
Much appreciated.

Scott. (not of Sainsbury's Loanhead)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top