How to do it on excel?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("A1:C1")
If Intersect(r, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
r.Value = Target.Value
Application.EnableEvents = True
End Sub

I would like to target on specific cells rather than range.
Could anyone tell me how to modify Range("A1:C1") into different cells? such
as A13, A67, A100.
Thank everyone for any suggestions
Eric
 
Hi Eric,

Set r = Union(Cells(13, 1), Cells(67, 1), Cells(100, 1))

or

Set r = Union(Range("A13"), Range("A67"), Range("A100"))

or

Set r = Union(Range("A13:A15"), Range("A67:A70"), Range("A100"))
 

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