P
Patrick C. Simonds
Someone in the Charting forum provided me the code below (which I have
modified) in my efforts to create a dynamic chart. It is intended place the
value of the cells in column C into column B.
My problem is, for my dynamic chart to work correctly, if there is a value
in cell (say C3) then I need that value placed in Cell B3. If the formula in
cell C3 has returned no value I need Cell B3 to be left blank, but the code
below places a 0 in any cell in column B were the formula in the
corresponding cell in column C returns no value.
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "E3:E1000" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Range("B3:B1000").Value = Me.Range("C3:C1000").Value
End If
ws_exit:
Application.EnableEvents = True
End Sub
modified) in my efforts to create a dynamic chart. It is intended place the
value of the cells in column C into column B.
My problem is, for my dynamic chart to work correctly, if there is a value
in cell (say C3) then I need that value placed in Cell B3. If the formula in
cell C3 has returned no value I need Cell B3 to be left blank, but the code
below places a 0 in any cell in column B were the formula in the
corresponding cell in column C returns no value.
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "E3:E1000" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Range("B3:B1000").Value = Me.Range("C3:C1000").Value
End If
ws_exit:
Application.EnableEvents = True
End Sub