Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find Heading & Apply Formula


-----------------------------------------------------------------------
A poll associated with this post was created, to vote and see th
results, please visit http://www.excelforum.com/showthread.php?threadid=57126
-----------------------------------------------------------------------
Question: Is this post good & make some sense or useful for other

- Goo
- Very Usefu
- Usefu
- Not Usefu
-----------------------------------------------------------------------

Hi,

In the attached excel sheet you can find 2 subheadings named Safet
and Waiting. Like this i have many sub headings in my excel sheets
Each sub heading contains some rows.

The below is the code i used to change the Font color based on th
date values.

Every thing works fine. My requirement is if any rows added unde
subheading "Safety" then i want to run the loop from 1 st row to las
row under this subheading which will change the color based on th
given date.

How to identify under which subheading the row is added and which i
first row and which is last row.


Code
-------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call CycleThrough
End Sub

Sub CycleThrough()
Dim Counter As Integer
If ActiveCell.Column = 3 And ActiveCell.Row = 1 And ActiveCell.Row <= 6 Then
For Counter = 1 To 6
If IsDate(Worksheets("Sheet2").Cells(Counter, 3).Value) = True Then
If Date - Worksheets("Sheet2").Cells(Counter, 3).Value = 100 Then
Worksheets("Sheet2").Cells(Counter, 3).Font.Color = 255
ElseIf (Date - Worksheets("Sheet2").Cells(Counter, 3).Value = 70) And (Date - Worksheets("Sheet2").Cells(Counter, 3).Value <= 100) Then
Worksheets("Sheet2").Cells(Counter, 3).Font.Color = 82400
ElseIf Date - Worksheets("Sheet2").Cells(Counter, 3).Value < 70 Then
Worksheets("Sheet2").Cells(Counter, 3).Font.Color = 25350
End If
End If
Next
End If
End Su
-------------------



Kindly help me to solve this.

Thanks,
Chock.:

+-------------------------------------------------------------------
|Filename: Book2.zip
|Download: http://www.excelforum.com/attachment.php?postid=5188
+-------------------------------------------------------------------

--
itchoc
-----------------------------------------------------------------------
itchock's Profile: http://www.excelforum.com/member.php...fo&userid=3021
View this thread: http://www.excelforum.com/showthread.php?threadid=57126

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
Apply a heading to two different rows Lame Excel Worksheet Functions 1 August 11th 08 11:49 PM
column heading formula EricBB Excel Worksheet Functions 8 November 15th 07 01:57 PM
how can I exclude a heading but show that heading in sheet. Hunter Excel Discussion (Misc queries) 4 January 8th 07 07:35 AM
Formula to Return Column Heading den4673 Excel Discussion (Misc queries) 4 February 13th 06 09:55 PM
In a table produce an value by column heading and row heading naflan Excel Worksheet Functions 1 December 27th 05 05:18 PM


All times are GMT +1. The time now is 09:07 PM.

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

About Us

"It's about Microsoft Excel"