NdNoviceHlp
Well-known Member
- Joined
- Nov 9, 2002
- Messages
- 3,636
The objective is to not chart zero values in a chart with an array source. I would like to replace the array zero values with #N/A which should then be ignored by the chart but... I can't seem to stumble across the correct syntax to replace the array zero values to #N/A in a format that the chart will accept. I've trialed the code(s) below without success. Any assistance will be appreciated. Dave
Code:
'CRVArr contains an array of arrays with chart source data
For Cnt = LBound(CRVArr(Index)) To UBound(CRVArr(Index))
'CRVArr(Index)(Cnt) = Replace$(CRVArr(Index)(Cnt), "0", "#N/A")
'CPFTArr(Index)(Cnt) = Replace$(CPFTArr(Index)(Cnt), "0", "#N/A")
If CRVArr(Index)(Cnt) <> 0 Then
CRVArr(Index)(Cnt) = CRVArr(Index)(Cnt)
CPFTArr(Index)(Cnt) = CPFTArr(Index)(Cnt)
Else
CRVArr(Index)(Cnt) = "#N/A" '"NA()" 'CVErr(xlErrNA)
CPFTArr(Index)(Cnt) = "#N/A" '"NA()" 'CVErr(xlErrNA)
End If
Next Cnt