#1   Report Post  
Posted to microsoft.public.excel.misc
chip_pyp
 
Posts: n/a
Default Simple macro help

I have a workbook with two sheets in it. the workbook is used to keep track
of machines in a particular location. on one sheet there is a weekly update
and the second sheet is a year to date tracker. what i'm trying to do is on
the weekly sheet i want to update the numbers for each location, weekly
obviously. on the other sheet i want it to keep track of the yearly amount.
for example on the weekly sheet i have 3 machines in memphis and 4 in los
angeles. the yearly sheet will read 3 for memphis and 4 for los angeles. then
at the end of week two i update the weekly sheet saying there were 5 machines
in memphis for that week and 1 in los angeles. the yearly will then
automatically update and say for the year there are 8 in memphis and 5 in los
angeles...this will keep going on thru out the whole year. surely there is a
macro for this, but what is it? thank you!
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Simple macro help

Do you maintain the weekly figures in separate columns? If so a formula will
do it.

=SUMPRODUCT((Sheet2!A1:A20="memphis")*(Sheet2!B1:M 20))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"chip_pyp" wrote in message
...
I have a workbook with two sheets in it. the workbook is used to keep

track
of machines in a particular location. on one sheet there is a weekly

update
and the second sheet is a year to date tracker. what i'm trying to do is

on
the weekly sheet i want to update the numbers for each location, weekly
obviously. on the other sheet i want it to keep track of the yearly

amount.
for example on the weekly sheet i have 3 machines in memphis and 4 in los
angeles. the yearly sheet will read 3 for memphis and 4 for los angeles.

then
at the end of week two i update the weekly sheet saying there were 5

machines
in memphis for that week and 1 in los angeles. the yearly will then
automatically update and say for the year there are 8 in memphis and 5 in

los
angeles...this will keep going on thru out the whole year. surely there is

a
macro for this, but what is it? thank you!



  #3   Report Post  
Posted to microsoft.public.excel.misc
chip_pyp
 
Posts: n/a
Default Simple macro help

Unfortuantely not. on the weekly spreadsheet i have memphis in c3 then
jackson in c4 and so on with about 13 other locations. there is only one spot
for the weekly figures so i wanted the yearly sheet to pull the number off
the weekly and add it to a stored number that way it is always accumulating
as the weekly is updating.

"Bob Phillips" wrote:

Do you maintain the weekly figures in separate columns? If so a formula will
do it.

=SUMPRODUCT((Sheet2!A1:A20="memphis")*(Sheet2!B1:M 20))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"chip_pyp" wrote in message
...
I have a workbook with two sheets in it. the workbook is used to keep

track
of machines in a particular location. on one sheet there is a weekly

update
and the second sheet is a year to date tracker. what i'm trying to do is

on
the weekly sheet i want to update the numbers for each location, weekly
obviously. on the other sheet i want it to keep track of the yearly

amount.
for example on the weekly sheet i have 3 machines in memphis and 4 in los
angeles. the yearly sheet will read 3 for memphis and 4 for los angeles.

then
at the end of week two i update the weekly sheet saying there were 5

machines
in memphis for that week and 1 in los angeles. the yearly will then
automatically update and say for the year there are 8 in memphis and 5 in

los
angeles...this will keep going on thru out the whole year. surely there is

a
macro for this, but what is it? thank you!




  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Simple macro help

Thought that might be the case.

Try this VBA solution

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "B2:B200"
Dim iPos As Long

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
On Error Resume Next
iPos = Application.Match(.Offset(0, -1).Value,
Worksheets("Sheet3").Range("A:A"), 0)
On Error GoTo 0
If iPos 0 Then
Worksheets("Sheet3").Range("B" & iPos).Value = _
Worksheets("Sheet3").Range("B" & iPos) + .Value
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--

HTH

RP
(remove nothere from the email address if mailing direct)


"chip_pyp" wrote in message
...
Unfortuantely not. on the weekly spreadsheet i have memphis in c3 then
jackson in c4 and so on with about 13 other locations. there is only one

spot
for the weekly figures so i wanted the yearly sheet to pull the number off
the weekly and add it to a stored number that way it is always

accumulating
as the weekly is updating.

"Bob Phillips" wrote:

Do you maintain the weekly figures in separate columns? If so a formula

will
do it.

=SUMPRODUCT((Sheet2!A1:A20="memphis")*(Sheet2!B1:M 20))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"chip_pyp" wrote in message
...
I have a workbook with two sheets in it. the workbook is used to keep

track
of machines in a particular location. on one sheet there is a weekly

update
and the second sheet is a year to date tracker. what i'm trying to do

is
on
the weekly sheet i want to update the numbers for each location,

weekly
obviously. on the other sheet i want it to keep track of the yearly

amount.
for example on the weekly sheet i have 3 machines in memphis and 4 in

los
angeles. the yearly sheet will read 3 for memphis and 4 for los

angeles.
then
at the end of week two i update the weekly sheet saying there were 5

machines
in memphis for that week and 1 in los angeles. the yearly will then
automatically update and say for the year there are 8 in memphis and 5

in
los
angeles...this will keep going on thru out the whole year. surely

there is
a
macro for this, but what is it? thank you!






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help In Excel welshlad Excel Discussion (Misc queries) 14 October 26th 05 02:34 PM
Simple macro please sasha New Users to Excel 1 July 19th 05 12:51 PM
Recording simple macro Dave Excel Worksheet Functions 5 July 16th 05 12:34 AM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 11:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"