Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default conditional formatting total

Hi
I am Useing conditional formatting to highlight items that are in a list
on the worksheet with function
=countif($d$1:$d$6,$A2)
is there any way when rows are selected can i get total of any perticular
column like qty filed or total filed etc..

Any help.
Tiya
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default conditional formatting total

without code....make sure the status bar is shown, and you can set the field
at the bottom right to show count or sum etc.

conditional formatting can't be used to do calculations.

you could use VBA to retrun the sum of a selected region...try the
Selection_Changed event like this...


Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim sum As Double
Dim cell As Range
Dim ok As Boolean
For Each cell In Target.Cells
If Not IsEmpty(cell) Then
If IsNumeric(cell.Value) Then
ok = True
sum = sum + cell.Value
End If
End If

Next
If ok Then
Application.StatusBar = "Total of selection = " & sum
Else
Application.StatusBar = False
End If

End Sub

"Tiya" wrote:

Hi
I am Useing conditional formatting to highlight items that are in a list
on the worksheet with function
=countif($d$1:$d$6,$A2)
is there any way when rows are selected can i get total of any perticular
column like qty filed or total filed etc..

Any help.
Tiya

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default conditional formatting total

Thank you vey much Patrick Molloy

Tiya

"Patrick Molloy" wrote:

without code....make sure the status bar is shown, and you can set the field
at the bottom right to show count or sum etc.

conditional formatting can't be used to do calculations.

you could use VBA to retrun the sum of a selected region...try the
Selection_Changed event like this...


Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim sum As Double
Dim cell As Range
Dim ok As Boolean
For Each cell In Target.Cells
If Not IsEmpty(cell) Then
If IsNumeric(cell.Value) Then
ok = True
sum = sum + cell.Value
End If
End If

Next
If ok Then
Application.StatusBar = "Total of selection = " & sum
Else
Application.StatusBar = False
End If

End Sub

"Tiya" wrote:

Hi
I am Useing conditional formatting to highlight items that are in a list
on the worksheet with function
=countif($d$1:$d$6,$A2)
is there any way when rows are selected can i get total of any perticular
column like qty filed or total filed etc..

Any help.
Tiya

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
Conditional Format: % of total AussieBec Excel Worksheet Functions 4 June 27th 09 08:01 AM
Formatting a Running Total Graph DTrifone Excel Discussion (Misc queries) 1 June 3rd 09 06:29 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
Conditional Total in a Cell LoriO Excel Discussion (Misc queries) 2 August 12th 06 08:01 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


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