ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how to add time total in msg box (https://www.excelbanter.com/excel-discussion-misc-queries/4180-how-add-time-total-msg-box.html)

khurram saddique

how to add time total in msg box
 
i am having a problem in time total , when i filter the time ie 03:10:25 the
macro add the total in msg box but the format changes ie the total becomes in
msg box is 1.23654654 something like that im using the following macro
i only want the sum of column of rows in msg box not at the end of cell


Sub ad()
Range("F1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-188]C:R[-1]C)"
Selection.NumberFormat = "[h]:mm:ss;@"
MsgBox ActiveCell.Value, vbMsgBoxRtlReading, Sum
End Sub


Peo Sjoblom

Try something like

MsgBox ActiveCell.Text, vbMsgBoxRtlReading, Sum


Regards,

Peo Sjoblom

"khurram saddique" wrote:

i am having a problem in time total , when i filter the time ie 03:10:25 the
macro add the total in msg box but the format changes ie the total becomes in
msg box is 1.23654654 something like that im using the following macro
i only want the sum of column of rows in msg box not at the end of cell


Sub ad()
Range("F1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-188]C:R[-1]C)"
Selection.NumberFormat = "[h]:mm:ss;@"
MsgBox ActiveCell.Value, vbMsgBoxRtlReading, Sum
End Sub



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

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