worksheet calculation

M

Marita

Hi Julie,
I was just using A & B as examples in place of g and I.

On worksheet one, I need to sum columns A & B to total in
automatically daily.

New inventory is entered into B(I) then the sum of all the inventor
sold up-to-date is in column A(G).

Thank you for helping,
Marit
 
J

JulieD

Hi Marita
On worksheet one, I need to sum columns A & B to total in A
automatically daily.

you can't achive this with a formula as you're saying, in effect
A1=A1+B1

what you'ld need to do is use a macro that when it runs does the calculation
for you and then clears out B1.

e.g.
Sub updatevalues()
Set myrange = Range("A1:A10")
For Each cell In myrange
cell.Value = cell.Value + cell.Offset(0, 1).Value
cell.Offset(0, 1).Value = ""
Next
End Sub

---
to use this code, right mouse click on the sheet tab and choose view code
choose insert / module from the menu and copy & paste the code onto the
white screen on the right hand side of the VBE window
change "A1:A10" to the actual range - probably column G that you want the
"to date" figures in

to run the code, press Alt & F11 to switch back to your workbook
make sure you're on the correct sheet and choose tools / macro / macros
click on updatevalus and press the run button.

Let me know how you go.

Cheers
JulieD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top