nrguades
Structural
- May 19, 2002
- 71
Hi..
I'm trying to write a simple vba for my excel spreadsheets. I'm wondering why this will cause my spreadsheet to hang when I input a value of 1 on B2.
I'm a structural engineer and novice on vba. I appreciate for your help.
Here's the code:
Sub Worksheet_Change(ByVal Target As Range)
If Range("a1").Value = 1 Then
Range("B1").Value = "-"
End If
If Range("a2").Value = 1 Then
Range("B2").Value = "-"
End If
End Sub
Thanks,
Noel
I'm trying to write a simple vba for my excel spreadsheets. I'm wondering why this will cause my spreadsheet to hang when I input a value of 1 on B2.
I'm a structural engineer and novice on vba. I appreciate for your help.
Here's the code:
Sub Worksheet_Change(ByVal Target As Range)
If Range("a1").Value = 1 Then
Range("B1").Value = "-"
End If
If Range("a2").Value = 1 Then
Range("B2").Value = "-"
End If
End Sub
Thanks,
Noel