Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chart-problem.

Status
Not open for further replies.

lode

Programmer
Nov 8, 2001
208
BE
Hi,

I setup a chart with the following datasource :

Januari 5000 --->is coming from a formula
Februari 4500 --->is coming from a formula
Maart 5900 --->is coming from a formula
etc...

How can i change the values of the second column in VBA wihout changing them at the worksheet because the cells at the worksheet containing formulas.
In fact my problem is that the chart has to deny zero-values.
 
Thanks for responding.

I figured this out already but when I hide the new column, the chart becomes blank.

Best regards.
 
I did not think that would happen.

If your chart's on it's own sheet, you can create another sheet with all of your data (just copy, go to new sheet, paste special-paste links), and base the chart on that sheet. Which you can hide, I just tested it. Brainbench MVP for Microsoft Word
techsupportgirl@home.com
 
I forgot something

In the new column i placed this :

=IF(C5=0;"";C5)
When C5 has a zero value then the cell in the new column becomes blank just as i wanted this BUT the chart gives me zero values instead of gaps.

Can you please help me out ??






 
Thank you very much, I also have 2000.
When i try the following code then the chart gives me gaps, so this works, but this is just the same as =IF(C5=0;"";C5)
I don't understand why the above doenst't work.

Private Sub Worksheet_Calculate()
For X = 5 To 16
If Cells(X, 3) = 0 Then '--->Original column
Cells(X, 12) = "" '--->New Column
Else
Cells(X, 12) = Cells(X, 3)
End If
Next
End Sub

Do you think this is a good solution, it works but....
 
Yes, I do. Just read a technote from MS that tells you about the "" not equaling blank, but they don't give an alternative. I was looking for code...

Is there something you don't like about the solution--other than that it requires code? Brainbench MVP for Microsoft Word
techsupportgirl@home.com
 
Thanks again,

When I have a problem mostly i figure something out but every time I think there are a lot of people who can do this better.

Best regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top