Transfer value to cell

  • Thread starter Thread starter Phil Floyd
  • Start date Start date
P

Phil Floyd

In cell D30 I will enter a number. I would like for that number to appear
in cell M30 then have the word "Material" to appear in cell D30. Below is
what I am trying to work with, but I always get "Material" in both D30 and
M30. How do I fix this?

Thanks,
Phil

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$30" Then
Range("M30") = Range("D30")
Range("D30") = "Material"
End If
End Sub
 
Thanks Frank. It works great.
Phil

Frank Kabel said:
Hi
You have to disable the worksheet events as otherwise your
macro entry will trigger this event again. try
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$30" Then
application.enableevents=false
Range("M30").value = target.value
Range("D30").value = "Material"
End If
application.enableevents=true
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top