View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Macro for a one time triggered copy of cell value

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$1" Then
If UCase(Target.Value) = "Y" Then
Application.EnableEvents = False
Range("B1").Copy
Range("C1").PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
End If
End If
End Sub

Mike

"Azrael" wrote:

I have hit a brick wall with my spreadhseet, due mainly to my lack of
experience with Macros (I didn't even know they existed until last Friday).

My requirements are as follows:
I have a spreadsheet that generates a random number once certain
requirements are met in other cells. This I have managed to create with no
real problems, but every time the spreadsheet refreshes, it changes the value
of every random number in the form.

I require a Macro, that triggered by the entry of a "Y" into cell A1, runs a
one time Macro, that doesn't repeat, to copy the entry in Cell B1, and paste
the value only into cell C1.

I have tried many approaches to this issue, and none have worked in the way
I want it to.