View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] MichaelRLanier@gmail.com is offline
external usenet poster
 
Posts: 36
Default Delete cell entry and default contents are restored, for multiplerows

I currently have a macro that allows the content in B1 to be reflected
in A1 until I enter a different number in A1. If I choose to delete
the entry I made in A1, by default the B1 content will once again
appear in A1. My macro is as follows:

Private Sub Worksheet_Change(ByVal TargetCell As Range)
If Not Intersect(TargetCell, Range("A1")) Is Nothing Then
If TargetCell = "" Then
TargetCell = "=B1"
End If
End If
End Sub

Here is my problem. I have approximately 3000 rows, all of which need
to perform in the same way as stated above. Instead of creating a
macro for each row, I need a single macro that will perform the
assignment. Can anyone offer a solution? I thank you in advance.