Texas Longhorn
Active Member
- Joined
- Sep 30, 2003
- Messages
- 493
Hi all,
I'm a newbie to VBA, and I was hoping someone could explain to me the difference between Select and Activate. For example, all four of the following do the same thing:
Could someone please explain if there is any reason to use one or the other (or neither)?
Thanks,
Bill
I'm a newbie to VBA, and I was hoping someone could explain to me the difference between Select and Activate. For example, all four of the following do the same thing:
Code:
Sub test()
Range("B2").Select
Range("B2").Copy Destination:=Selection.Offset(0, 1)
End Sub
Code:
Sub test()
Range("B2").Activate
Range("B2").Copy Destination:=ActiveCell.Offset(0, 1)
End Sub
Code:
Sub test()
Range("B2").Select
Range("B2").Copy Destination:=ActiveCell.Offset(0, 1)
End Sub
Code:
Sub test()
Range("B2").Activate
Range("B2").Copy Destination:=Selection.Offset(0, 1)
End Sub
Could someone please explain if there is any reason to use one or the other (or neither)?
Thanks,
Bill