Results 1 to 3 of 3

Need help with amending code

Threaded View

ea223 Need help with amending code 03-19-2013, 11:39 PM
Leith Ross Re: Need help with amending... 03-20-2013, 12:03 AM
ea223 Re: Need help with amending... 03-20-2013, 01:10 AM
  1. #1
    Forum Contributor
    Join Date
    10-18-2012
    Location
    new york
    MS-Off Ver
    Office 365
    Posts
    177

    Need help with amending code

    I have the below code to hide a chart when there is no value in A1. The problem I have is A1 is actually a formula =IF(Sheet1!a2<>"",Sheet1!a2,"")
    so it does not work when A1 is "blank". I need the chart to be hidden when the formula generates a blank and visible when the formula generates a value (sheet1 a2).
    FYI i have 20 charts with 20 corresponding cells!

    Can anyone help me fix the code?
    Private Sub Worksheet_Change(ByVal Target As Range)
        
        If Not Intersect(Range("A1"), Target) Is Nothing Then
            Me.ChartObjects("Chart 1").Visible = Range("A1").Value <> ""
        End If
        
    End Sub
    Last edited by Leith Ross; 03-19-2013 at 11:52 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1