ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message box to show cell value (https://www.excelbanter.com/excel-programming/309179-message-box-show-cell-value.html)

scottwilsonx[_29_]

Message box to show cell value
 
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

--
Message posted from http://www.ExcelForum.com


Iain King

Message box to show cell value
 
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



Gaz[_2_]

Message box to show cell value
 
Are you Iain King of Sainsbury's, Loanhead fame???


-----Original Message-----
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 King

Message box to show cell value
 

"Gaz" wrote in message
...
Are you Iain King of Sainsbury's, Loanhead fame???


Err... Do I get something if I am?

Iain King



scottwilsonx[_30_]

Message box to show cell value
 
Iain, many thanks for the post.
Much appreciated.

Scott. (not of Sainsbury's Loanhead)

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com