Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Circling cells based on a value

What I'm trying to do is circle cells(J14 and R14) based on thier
value(empty cell no circle, occupied cell circled). I can only get one
circle to appear not two, and to make the circle dissappear I have to
manually run another macro. This is what I have so far, and is it
possible to all the code on the active sheet only?

for the workbook I have:

Sub Hide_It()
ActiveSheet.Shapes("Oval 2").Visible = False
ActiveSheet.Shapes("Oval 6").Visible = False
End Sub

and for the Active sheet I have:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count 1 Then Exit Sub
With Range("j14")
If .Value 0 Then
ActiveSheet.Shapes("Oval 2").Visible = True
End If
End With
End Sub

any help would be greatful, thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Allllen
 
Posts: n/a
Default Circling cells based on a value

Assuming that oval 2 is the one around j14 and oval 6 is the one around r14:

1 completely get rid of sub Hide_It()
2 not sure that you really want that target.count 1 question in there
3 use this (it only works on the active sheet anyway)

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$J$14" Then
If Range("j14") = "" Then ActiveSheet.Shapes("Oval 2").Visible = False
Else ActiveSheet.Shapes("Oval 2").Visible = True
End If

If Target.Address = "$R$14" Then
If Range("r14") = "" Then ActiveSheet.Shapes("Oval 6").Visible = False
Else ActiveSheet.Shapes("Oval 6").Visible = True
End If

End Sub

Please give me a green tick if this is a correct answer for you.

--
Allllen


" wrote:

What I'm trying to do is circle cells(J14 and R14) based on thier
value(empty cell no circle, occupied cell circled). I can only get one
circle to appear not two, and to make the circle dissappear I have to
manually run another macro. This is what I have so far, and is it
possible to all the code on the active sheet only?

for the workbook I have:

Sub Hide_It()
ActiveSheet.Shapes("Oval 2").Visible = False
ActiveSheet.Shapes("Oval 6").Visible = False
End Sub

and for the Active sheet I have:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count 1 Then Exit Sub
With Range("j14")
If .Value 0 Then
ActiveSheet.Shapes("Oval 2").Visible = True
End If
End With
End Sub

any help would be greatful, thanks


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Circling cells based on a value

You were correct on what I'm trying to do, but it still doesn't work.
If J13 is the sum of c13-i13 and r13 is the sum of k13-q13, I end up
with a zero in J&R13 so I replaced your """ with 0. But the ovals don't
go away when I have a "0", they only way the ovals hide is to remove
the sum from these cells, but the oval swaps back and forth between the
two cells.



Allllen wrote:
Assuming that oval 2 is the one around j14 and oval 6 is the one around r14:

1 completely get rid of sub Hide_It()
2 not sure that you really want that target.count 1 question in there
3 use this (it only works on the active sheet anyway)

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$J$14" Then
If Range("j14") = "" Then ActiveSheet.Shapes("Oval 2").Visible = False
Else ActiveSheet.Shapes("Oval 2").Visible = True
End If

If Target.Address = "$R$14" Then
If Range("r14") = "" Then ActiveSheet.Shapes("Oval 6").Visible = False
Else ActiveSheet.Shapes("Oval 6").Visible = True
End If

End Sub

Please give me a green tick if this is a correct answer for you.

--
Allllen


" wrote:

What I'm trying to do is circle cells(J14 and R14) based on thier
value(empty cell no circle, occupied cell circled). I can only get one
circle to appear not two, and to make the circle dissappear I have to
manually run another macro. This is what I have so far, and is it
possible to all the code on the active sheet only?

for the workbook I have:

Sub Hide_It()
ActiveSheet.Shapes("Oval 2").Visible = False
ActiveSheet.Shapes("Oval 6").Visible = False
End Sub

and for the Active sheet I have:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count 1 Then Exit Sub
With Range("j14")
If .Value 0 Then
ActiveSheet.Shapes("Oval 2").Visible = True
End If
End With
End Sub

any help would be greatful, thanks



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Circling cells based on a value






Allllen wrote:
Assuming that oval 2 is the one around j14 and oval 6 is the one around r14:

1 completely get rid of sub Hide_It()
2 not sure that you really want that target.count 1 question in there
3 use this (it only works on the active sheet anyway)

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$J$14" Then
If Range("j14") = "" Then ActiveSheet.Shapes("Oval 2").Visible = False
Else ActiveSheet.Shapes("Oval 2").Visible = True
End If

If Target.Address = "$R$14" Then
If Range("r14") = "" Then ActiveSheet.Shapes("Oval 6").Visible = False
Else ActiveSheet.Shapes("Oval 6").Visible = True
End If

End Sub

Please give me a green tick if this is a correct answer for you.

--
Allllen


" wrote:

What I'm trying to do is circle cells(J14 and R14) based on thier
value(empty cell no circle, occupied cell circled). I can only get one
circle to appear not two, and to make the circle dissappear I have to
manually run another macro. This is what I have so far, and is it
possible to all the code on the active sheet only?

for the workbook I have:

Sub Hide_It()
ActiveSheet.Shapes("Oval 2").Visible = False
ActiveSheet.Shapes("Oval 6").Visible = False
End Sub

and for the Active sheet I have:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count 1 Then Exit Sub
With Range("j14")
If .Value 0 Then
ActiveSheet.Shapes("Oval 2").Visible = True
End If
End With
End Sub

any help would be greatful, thanks



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Circling cells based on a value

See if this no-vba method works for you.

Basic procedu
1)Draw the oval shape around cell J14 and set the fill property to transparent

2)Move that shape and to a blank area of the workbook
(I'll assume AA1 and that cells AA1:AB3 enclose it)
(I'll also assume that cell Z1 is blank)

3)Create this Dynamic Range Name
Names in workbook: picOval_J14
Refers to: =IF(ISBLANK($J$14),$Z$1,$AA$1:$AB$3)

4)Copy cell J14
5)Hold down the [shift] key and, from the Excel menu: <edit<paste picture

While that picture is still selected...
6)In the formula bar enter: =picOval_J14, then press [enter]

Now...
if there is a value in J14 the image will display the oval in AA1:AB3
If J14 is blank the image will display the Z1 (the blank cell)
Note: for best results, turn off grid lines

Fr cell R14, repeat steps 3 thru 6 (referring to R14, instead of J14)

Is that something you can work with?

***********
Regards,
Ron

XL2002, WinXP


" wrote:

What I'm trying to do is circle cells(J14 and R14) based on thier
value(empty cell no circle, occupied cell circled). I can only get one
circle to appear not two, and to make the circle dissappear I have to
manually run another macro. This is what I have so far, and is it
possible to all the code on the active sheet only?

for the workbook I have:

Sub Hide_It()
ActiveSheet.Shapes("Oval 2").Visible = False
ActiveSheet.Shapes("Oval 6").Visible = False
End Sub

and for the Active sheet I have:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count 1 Then Exit Sub
With Range("j14")
If .Value 0 Then
ActiveSheet.Shapes("Oval 2").Visible = True
End If
End With
End Sub

any help would be greatful, thanks


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 Formatting based on other cells userzero Excel Worksheet Functions 4 April 6th 06 11:16 PM
how do i format a cell based on format of a range of cells? Chris Hardick Excel Discussion (Misc queries) 2 April 3rd 06 08:54 AM
Applying conditional formatting to cell based on another cell's in kdesemple Excel Discussion (Misc queries) 1 March 22nd 06 06:37 PM
Add cells from a range based on 2 conditions from 2 other ranges Kelly Excel Worksheet Functions 3 July 7th 05 07:40 PM
Calculate percentage based on cells with conditional formatting Cachod1 New Users to Excel 5 April 4th 05 02:11 PM


All times are GMT +1. The time now is 08:58 AM.

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"