Sums & Colours

DeskFlyer

New Member
Joined
May 5, 2004
Messages
9
Hi All,

have a unique request....
In the example below
Beenleigh Mall 2004WS.xls
RSTU
35Total
36TotalHoursWages
37 
3838.0038.000.00
39  
4023.7537.250.00
417.000.00
426.500.00
43  
446.006.000.00
SUMMARY


I want to......in the first cell in column S underneath each grey cell, sum the hours in column R for the cells inbetween the grey cells (which serve as 'markers' for different employees).
In S38 i just want it be R38, but in S40 (the 1st white cell after the next grey cell), i want it to sum R40:R42 (ie, up to the next grey cell which marks a change in employee)

Is this possible in any way?

Thanks

DF
 
Hi
Crossed messages.
The macro should only run when you make a change in row R.
The event macro should be in the window that opens when you go to the VB Editor via the sheet tab. The Total macro needs to be in a standard module in the same workbook. You should be able to locate the module in the projects window of the VB Editor. Alternativelly from the worksheet, select Tools/Macro/Macros (select the macro Total)/ Edit. This should take you to the module containing the macro.

hope this makes sense to you.
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Ok, well that all makes sense now, but is it possible to have it run without directly editing a cell in column R?

the cell in column J of any row uses data validation to allow the user to select one of three options which in turn changes the hours worked and this is reflected in the sum function in column R - the code for Worksheet_Change macro doesn't appear to handle this.

can that be done using the following somehow?

Private Sub Worksheet_Calculate()

End Sub

cheers
Phil
 
Upvote 0
If I follow you correctly you actually want the code to run if a change is made to any cell in column J (ie column 10). In that case change the 18 in the event macro to 10.

regards
Derek
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,050
Members
449,206
Latest member
Healthydogs

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