Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default count resize range

Hey,

I need a VBA code that count the number of times "cf" occurs in the 14 cells
to the left of every cell, including the cell, in a range and change the
bottom border line to a thick red line if the count exceeds 4.

What I'm trying to do is point out if someone has been scheduled "cf" more
than 4 times in the past 14 days.

Is this possible at all?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default count resize range

Since you did not specify the columns and rows, I used columns A thru O,
with O being the one that holds the criteria to identify which rows to count
the "cf" in. You can alter the macro to suit your actual sheet content.

Sub dk()
Dim lr As Long, sh As Worksheet
Dim rng As Range, fRng As Range, c As Range
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 15).End(xlUp).Row
Set rng = sh.Range("O2:O" & lr)
For Each c In rng
Set fRng = sh.Range("A" & c.Row & ":O" & c.Row)
If WorksheetFunction.CountIf(fRng, "cf") 4 Then
With fRng.Borders(xlEdgeBottom)
.LineStyle = Solid
.Weight = xlThick
.ColorIndex = 3
End With
End If
Next
End Sub



"roster_jon" wrote in message
...
Hey,

I need a VBA code that count the number of times "cf" occurs in the 14
cells
to the left of every cell, including the cell, in a range and change the
bottom border line to a thick red line if the count exceeds 4.

What I'm trying to do is point out if someone has been scheduled "cf" more
than 4 times in the past 14 days.

Is this possible at all?



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
Resize Table Range to exclude zero values and Input New Range into achart object jparnold Excel Programming 10 December 22nd 09 04:09 PM
resize range Norma Excel Programming 3 October 16th 08 09:05 PM
Set new range based on rng.Offset(rng.Rows.Count, 0).Resize(1, 1) Keith Excel Programming 2 January 7th 07 08:35 PM
Range.Delete and Range.Resize.Name performance issues Test.File Excel Programming 0 February 15th 05 03:33 PM
Range Resize jacqui Excel Programming 2 April 6th 04 06:22 PM


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