title: Excel VBA Range(Cell).Value=sum 1004:Application-Defined Or Object-Defined
body: <pre><code>Function ChangeColVal(ByVal Rng As Range, ByVal ValueToChange As Integer)
      Dim Cell1, Cell2 As String
      Dim PosOfColon, TotalCell, Sum As Integer
      PosOfColon = InStr(1, Rng.Address, ":")
      Cell1 = Left(Rng.Address, PosOfColon - 1)
      Cell2 = Right(Rng.Address, Len(Rng.Address) - PosOfColon)
      If Left(Cell1, 2) = Left(Cell2, 2) Then
          TotalCell = Rng.Count
          For i = 0 To TotalCell
              If IsNumeric(Range(Cell1).Offset(i, 0).Value) = False Then
                  GoTo 112:
              End If
              Cell2 = Range(Cell1).Offset(i, 0).Address
              Sum = Range(Cell2).Cells.Value + ValueToChange
              On Error GoTo 111
              'Here getting error...
              Range(Cell2).Value = Sum
              GoTo 112
  111:
              MsgBox (Err.Number &amp; ":" &amp; Err.Description)
  112:
          Next i
      Else
          MsgBox ("Select Column only...")
      End If
  End Function
  </code></pre>
  
  <p>I wants to increase or decrease cell value of selected range.
  I am getting error in line <code>Range(Cell2).Value = Sum</code></p>
  
  <p><strong>Edit</strong><br>
  thanx for reply, in line Range(Cell2).Value = Sum, Cell2 is pointing to cell address like $E$6.
  <img src="https://i.stack.imgur.com/Gsz8O.png" alt="a"></p>
  
  <p>If there is any option other than that pls let me know</p>