sum value of two range's

Fyr

Active Member
Joined
Jan 20, 2009
Messages
375
I'm trying to take two cell values, which are times, and do a subtraction equation. Then take the value of the subtraction and put it in the next available row in a column.

Here is what came up with so far, but it's not working:
Code:
Sheets(ShName).Range("cz" & Rows.Count).End(xlUp).Row = Range("K6").Value - Range("I6").Value

Error i'm getting is
"Run-time error '450'
Wrong number of arguments or invalid property assignment"

thanks for taking a look!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Your current code is trying to write the result of the subtraction to a particular row, not a particular cell. Try this:

Sheets(ShName).Range("cz" & Rows.Count).End(xlUp).Offset(1,0).Value = Range("K6").Value - Range("I6").Value
 
Upvote 0
Try without .Row

Code:
Sheets(ShName).Range("cz" & Rows.Count).End(xlUp) = Range("K6").Value - Range("I6").Value
 
Upvote 0

Forum statistics

Threads
1,213,530
Messages
6,114,162
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top