LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Cathy Landry
 
Posts: n/a
Default SUMIF Function?

Hi Ken,

I sent a sample to your email listed below.

Thank you
Cathy

"Ken Hudson" wrote:

The macro is written to sort columns A through D. Don't know why it isn't
working.
If possible, please send me a sample of your workbook (maybe 20-30 rows) and
I will see what's going on.


--
Ken Hudson


"Cathy Landry" wrote:

Hi Ken,

Yes it does, but when I run the macro it just sort and highlights, but the
other columns didn't sort. So, I have let's say Ken who's monthly limit is
5K, now is showing different monthly limits on his trans$ line. The
cardholders don't have the same monthly limits they range from 500 - 20,000

"Ken Hudson" wrote:

Hi,
Doesn't your data look like this:

Ken $12 $100 7/1/05
Kathy $3 $100 7/23/05
Ken $15 $100 7/24/05
.......

If it does, your saying that all rows didn't get sorted or all columns?

--
Ken Hudson


"Cathy Landry" wrote:

Hi Ken,

It didn't sort all of the rows just the cardholders. Did I do something
wrong?

"Ken Hudson" wrote:

Cathy,
Here is a macro solution.
Right click on any worksheet tab at the botom of your workbook and select
"View Code."
Go to Insert Module.
Copy the code from below and paste it into your module.
Close the VB editor.
Back in Excel go to Tools Macro Macros..., select the macro and click Run.
This macro will sort your data by user and highlight those users who have
reached or exceeded their limit.
Be sure to make a back-up copy of your workbook beforehand.

Sub CheckLimit()
Dim CumTtl As Double
Dim Iloop As Single
Dim NumRows As Single

'Turn off warnings, etc.
Application.ScreenUpdating = False
Application.DisplayAlerts = False

NumRows = Range("A65536").End(xlUp).Row
Range("A1:D" & NumRows).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, _
Key2:=Range("D1"), Order2:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
For Iloop = 2 To NumRows
If Cells(Iloop, "A") = Cells(Iloop + 1, "A") Then
CumTtl = CumTtl + Cells(Iloop, "B")
Else
CumTtl = CumTtl + Cells(Iloop, "B")
If CumTtl = Cells(Iloop, "C") Then
Rows(Iloop).Font.Bold = True
CumTtl = 0
End If
End If
Next Iloop

'Turn off warnings, etc.
Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub


--
Ken Hudson


"Cathy Landry" wrote:

Hello,

I have 4 columns
A=cardholder
B=trans$
C=monthly limit
D=trans date

Each cardholder could have multiple transaction for a reporting period. I
want to be able to show those cardholders that reach their monthly limits.
My sheet currently has over 11K lines with each cardholder having at least
5-10 trans lines.

Is this possible??

Thank you in advance for any help!

 
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
SumIF function ACDenver Excel Discussion (Misc queries) 2 August 17th 05 09:47 PM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
SUMIF function yak10 Excel Worksheet Functions 0 February 12th 05 05:12 PM
help with "criterea" in the sumif function [email protected] Excel Worksheet Functions 3 December 17th 04 06:27 PM
how do you do a sumif function on more than one worksheet? BMWPRO Excel Worksheet Functions 1 December 6th 04 08:26 PM


All times are GMT +1. The time now is 10:29 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"