Need another vba copy cell value to another cell with sum

richter_2100

Board Regular
Joined
Feb 22, 2008
Messages
84
Hi Guys - I need another help to create a <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">vba</acronym> to copy data from a cell to another cell. This will be big help for me automating my data.
In example below, We just want to take the sum of the location "TBD" and "TBI" and copy it below the last row. Thanks!

 

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.
Hello,

Can't access your image, but the code to copy one cell to another is:

Code:
Sub COPY()
    Range("D3").COPY Range("E5").End(xlDown).Offset(1, 0)
End Sub

change cell refs as required.
 
Upvote 0
Not sure what your objective is. Do you want a sum of all values of TBD's in row "price A" in the last row, and the same for "price B" etc?
And under that result the same for TBI values?
 
Upvote 0
If you can see the image you will get what i mean. :)

I want the sum of TBD row and TBI row, Price A,B,C,D and so on. Then put this below the last row.
 
Upvote 0
<b>Here is what i need..</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:64px;" /><col style="width:64px;" /><col style="width:64px;" /><col style="width:50px;" /><col style="width:49px;" /><col style="width:49px;" /><col style="width:50px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td><td >F</td><td >G</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="background-color:#003366; color:#ffffff; ">Names</td><td style="background-color:#003366; color:#ffffff; ">Fruits</td><td style="background-color:#003366; color:#ffffff; ">Location</td><td style="background-color:#003366; color:#ffffff; ">Price A</td><td style="background-color:#003366; color:#ffffff; ">Price B</td><td style="background-color:#003366; color:#ffffff; ">Price C</td><td style="background-color:#003366; color:#ffffff; ">Price D</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td >Peter</td><td >Apple</td><td >TMF</td><td style="text-align:right; ">100</td><td style="text-align:right; ">100</td><td style="text-align:right; ">100</td><td style="text-align:right; ">200</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="background-color:#ffff00; ">Peter</td><td style="background-color:#ffff00; ">Apple</td><td style="background-color:#ffff00; ">TBD</td><td style="background-color:#ffff00; text-align:right; ">0</td><td style="background-color:#ffff00; text-align:right; ">0</td><td style="background-color:#ffff00; text-align:right; ">0</td><td style="background-color:#ffff00; text-align:right; ">0</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="background-color:#ffff00; ">Peter</td><td style="background-color:#ffff00; ">Apple</td><td style="background-color:#ffff00; ">TBI</td><td style="background-color:#ffff00; text-align:right; ">200</td><td style="background-color:#ffff00; text-align:right; ">200</td><td style="background-color:#ffff00; text-align:right; ">200</td><td style="background-color:#ffff00; text-align:right; ">100</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td >John</td><td >Orange</td><td >TMF</td><td style="text-align:right; ">100</td><td style="text-align:right; ">100</td><td style="text-align:right; ">100</td><td style="text-align:right; ">200</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="background-color:#ffff00; ">John</td><td style="background-color:#ffff00; ">Orange</td><td style="background-color:#ffff00; ">TBD</td><td style="background-color:#ffff00; text-align:right; ">0</td><td style="background-color:#ffff00; text-align:right; ">0</td><td style="background-color:#ffff00; text-align:right; ">0</td><td style="background-color:#ffff00; text-align:right; ">0</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td style="background-color:#ffff00; ">John</td><td style="background-color:#ffff00; ">Orange</td><td style="background-color:#ffff00; ">TBI</td><td style="background-color:#ffff00; text-align:right; ">200</td><td style="background-color:#ffff00; text-align:right; ">200</td><td style="background-color:#ffff00; text-align:right; ">200</td><td style="background-color:#ffff00; text-align:right; ">100</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td >John</td><td >Orange</td><td >TJZ</td><td style="text-align:right; ">100</td><td style="text-align:right; ">100</td><td style="text-align:right; ">100</td><td style="text-align:right; ">200</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >9</td><td >John</td><td >Orange</td><td >TZI</td><td style="text-align:right; ">0</td><td style="text-align:right; ">0</td><td style="text-align:right; ">0</td><td style="text-align:right; ">0</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >10</td><td >Paul</td><td >Mango</td><td >TJZ</td><td style="text-align:right; ">200</td><td style="text-align:right; ">200</td><td style="text-align:right; ">200</td><td style="text-align:right; ">100</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >11</td><td >Paul</td><td >Mango</td><td >TZI</td><td style="text-align:right; ">100</td><td style="text-align:right; ">100</td><td style="text-align:right; ">100</td><td style="text-align:right; ">200</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >12</td><td >Paul</td><td >Mango</td><td >TMF</td><td style="text-align:right; ">0</td><td style="text-align:right; ">0</td><td style="text-align:right; ">0</td><td style="text-align:right; ">0</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >13</td><td >Paul</td><td >Mango</td><td >TCL</td><td style="text-align:right; ">200</td><td style="text-align:right; ">200</td><td style="text-align:right; ">200</td><td style="text-align:right; ">100</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >14</td><td style="background-color:#ffff00; ">Mark</td><td style="background-color:#ffff00; ">Lemon</td><td style="background-color:#ffff00; ">TBD</td><td style="background-color:#ffff00; text-align:right; ">200</td><td style="background-color:#ffff00; text-align:right; ">200</td><td style="background-color:#ffff00; text-align:right; ">200</td><td style="background-color:#ffff00; text-align:right; ">100</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >15</td><td style="background-color:#ffff00; ">Mark</td><td style="background-color:#ffff00; ">Lemon</td><td style="background-color:#ffff00; ">TBI</td><td style="background-color:#ffff00; text-align:right; ">100</td><td style="background-color:#ffff00; text-align:right; ">100</td><td style="background-color:#ffff00; text-align:right; ">100</td><td style="background-color:#ffff00; text-align:right; ">200</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >16</td><td style="background-color:#008080; ">Peter</td><td style="background-color:#008080; ">Apple</td><td style="background-color:#008080; ">TBDI</td><td style="background-color:#008080; text-align:right; ">200</td><td style="background-color:#008080; text-align:right; ">200</td><td style="background-color:#008080; text-align:right; ">200</td><td style="background-color:#008080; text-align:right; ">100</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >17</td><td style="background-color:#008080; ">John</td><td style="background-color:#008080; ">Orange</td><td style="background-color:#008080; ">TBDI</td><td style="background-color:#008080; text-align:right; ">200</td><td style="background-color:#008080; text-align:right; ">200</td><td style="background-color:#008080; text-align:right; ">200</td><td style="background-color:#008080; text-align:right; ">100</td></tr><tr style="height:20px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >18</td><td style="background-color:#008080; ">Mark</td><td style="background-color:#008080; ">Lemon</td><td style="background-color:#008080; ">TBDI</td><td style="background-color:#008080; text-align:right; ">300</td><td style="background-color:#008080; text-align:right; ">300</td><td style="background-color:#008080; text-align:right; ">300</td><td style="background-color:#008080; text-align:right; ">300</td></tr></table> <br /><br /><span style="font-family:Arial; font-size:9pt; font-weight:bold;background-color:#ffffff; color:#000000; ">Excel tables to the web >> </span>
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,272
Members
448,558
Latest member
aivin

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