Hi,
My question is 2-fold.
What I want is when I make a selection on a worksheet and then enter a value in the active cell that the value is automaically copied to the other cells of the selection.
I tried to do this with a procedure. Here is the code
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Row > 1 And Target.Column > 1 And Sh.Index >= 3 And Sh.Index <= 9 And bUserchange Then
For Each c In Selection.Cells
c.Value = ActiveCell.Value
Next c
End If
End Sub
The problem is that the line
c.Value = ActiveCell.Value
again calls this procedure which results in an infinite loop of calling the same procedure from within itself.
So if anyone can tell me how to prevent this "internal" procedure call or any other way to adapt my code or another way to copy the data from the activecell to the other cells of the selection I would be very thankfull
My question is 2-fold.
What I want is when I make a selection on a worksheet and then enter a value in the active cell that the value is automaically copied to the other cells of the selection.
I tried to do this with a procedure. Here is the code
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Row > 1 And Target.Column > 1 And Sh.Index >= 3 And Sh.Index <= 9 And bUserchange Then
For Each c In Selection.Cells
c.Value = ActiveCell.Value
Next c
End If
End Sub
The problem is that the line
c.Value = ActiveCell.Value
again calls this procedure which results in an infinite loop of calling the same procedure from within itself.
So if anyone can tell me how to prevent this "internal" procedure call or any other way to adapt my code or another way to copy the data from the activecell to the other cells of the selection I would be very thankfull