Hi All,
I am getting an out of range error on the below green and bold line. I am attaching the Sub to a button to call it. Does anyone know why this error is coming up? There is a value in the sheet and within the cell.
Sub AddNumbersFromSheets()
Dim valueFromSheet1 As Double
Dim valueFromSheet3 As Double
Dim Total As Double
valueFromSheet1 = CDbl(Sheets("Sheet1").Range("E10").Value)
valueFromSheet3 = CDbl(Sheets("Sheet3").Range("C5").Value)
Total = valueFromSheet1 + valueFromSheet3
Worksheets(Sheet3).Range("C5").Value = Total
MsgBox "Thank you"
End Sub
I am getting an out of range error on the below green and bold line. I am attaching the Sub to a button to call it. Does anyone know why this error is coming up? There is a value in the sheet and within the cell.
Sub AddNumbersFromSheets()
Dim valueFromSheet1 As Double
Dim valueFromSheet3 As Double
Dim Total As Double
valueFromSheet1 = CDbl(Sheets("Sheet1").Range("E10").Value)
valueFromSheet3 = CDbl(Sheets("Sheet3").Range("C5").Value)
Total = valueFromSheet1 + valueFromSheet3
Worksheets(Sheet3).Range("C5").Value = Total
MsgBox "Thank you"
End Sub