Assign macro to enter

D

Diana

Hi,

I want to run this macro when I press Enter:

"select the client to create the invoice moving with the arrows or
going directly with the mouse and when I press enter on that client
send the data to the invoice sheet"

Sub sendclient ()
client=Selection.value
SHEETS("invoices").select
range("A5").value=cliente
End Sub
"The client is in column 2"

Thank you
 
D

Don Guillett

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Or Target.Count > 1 Then Exit Sub
sheets("invoice").Range("a5").Value = Target.Value
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

Top