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!

 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,696
Platform
  1. Windows
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.
 

richter_2100

Board Regular
Joined
Feb 22, 2008
Messages
84

ADVERTISEMENT

still strugling on this.. :(
 

Ghris

Board Regular
Joined
Mar 17, 2012
Messages
73
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?
 

richter_2100

Board Regular
Joined
Feb 22, 2008
Messages
84

ADVERTISEMENT

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.
 

richter_2100

Board Regular
Joined
Feb 22, 2008
Messages
84
<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>
 

Watch MrExcel Video

Forum statistics

Threads
1,108,924
Messages
5,525,657
Members
409,658
Latest member
Yardcell

This Week's Hot Topics

Top