Hello everyone, I'm new to the fourm and need your help.
I'm trying to sum a range by using an inputbox then displaying the results in a message box.
My problem is that the inputbox returns True instead of the range, I don't really know how to pass the range to the Sum function so I tried what I have written, Can anyone help?
here is the code:
Sub MyRange()
'On Error GoTo Quit
Dim RngA As Range
Dim myAnswer As Variant
Set RngA = Application.InputBox(prompt:="Entrer the range of cels", Type:=8)
RngA.Activate
MsgBox RngA.Select
myAnswer = Application.Sum(RngA.Select)
MsgBox ("Total hours = " & myAnswer)
'Quit:
End Sub
Bookmarks