vba copy rounded sum of range to another workbook

wynandbez

New Member
Joined
Feb 4, 2008
Messages
27
Hi All,

I'd like to copy the sum of a range from one workbook and paste the rounded value into another workbook. Not too sure how to code this in VBA...

E.g.

Source workbook
Cell A1: 100,000,000
Cell A2: 200,000,000
Cell A3: 300,000,000

Sum = 600,000,000

Destination workbook
Cell A1: 600

(Rounded to the nearest million)

Appreciate any help
Thanks!
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Ruthanne

Board Regular
Joined
Mar 2, 2004
Messages
123
As an amateur I would avoid using vba and just put the following formula in a dummy cell (perhaps Cell A4 of the Source workbook):
=ROUND(SUM(A1:A3),-6)

then in Cell A1 of the Destination workbook I would put the formula:
=[source.xls]Sheet1!$A$4

...or you could use the vba recorder to go through the steps and use the vba code from there...

Hope this helps and doesn't hurt!
 

Watch MrExcel Video

Forum statistics

Threads
1,099,008
Messages
5,466,002
Members
406,460
Latest member
tryingtogoalone

This Week's Hot Topics

Top