FROGGER24
Well-known Member
- Joined
- May 22, 2004
- Messages
- 704
- Office Version
- 2013
- 2010
- Platform
- Windows
Would like help in troubleshooting my code for a loop.
this is what i have tried so far. I am getting error 'Run time 1004 -Method range of object _Global failed.
<Sub subtract_col()
Dim LR As Long, i As Long
LR = Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To LR
Cells(i, 10).Value = Range(i, 24).Value - Range(i, 26).Value
Next i
End Sub>
If i use the code like this there is no error
Range("J2").Value = Range("x2").Value - Range("z2").Value
Thanks for you help and time!
this is what i have tried so far. I am getting error 'Run time 1004 -Method range of object _Global failed.
<Sub subtract_col()
Dim LR As Long, i As Long
LR = Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To LR
Cells(i, 10).Value = Range(i, 24).Value - Range(i, 26).Value
Next i
End Sub>
If i use the code like this there is no error
Range("J2").Value = Range("x2").Value - Range("z2").Value
Thanks for you help and time!