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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

njimack

Well-known Member
Joined
Jun 17, 2005
Messages
7,772
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

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try without .Row

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

Forum statistics

Threads
1,191,707
Messages
5,988,192
Members
440,138
Latest member
yanaa

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
Top