Fredrik1987
Board Regular
- Joined
- Nov 5, 2015
- Messages
- 69
Hi!
I'm using the function target.offset(, 1).value quite often in a worksheet script, so I was thinking that it would been alot easier if it was possible to asign this function to a specific letter, e.g.:
set a1 = target.offset(, 1).value
so instead of writing "target.offset()... = someValue" I could just write "a1 = someValue".
I'm not sure how to assign this property to a function, do I have to create a module or something?
I would much prefer if it was possible to implement this directly in the sub.
Basically, what I want to do is:
I'm using the function target.offset(, 1).value quite often in a worksheet script, so I was thinking that it would been alot easier if it was possible to asign this function to a specific letter, e.g.:
set a1 = target.offset(, 1).value
so instead of writing "target.offset()... = someValue" I could just write "a1 = someValue".
I'm not sure how to assign this property to a function, do I have to create a module or something?
I would much prefer if it was possible to implement this directly in the sub.
Basically, what I want to do is:
Code:
Sub Worksheet_Change(ByVal Target As Range)
set a1 = target.offset(, 1).value
set a2 = target.offset(, 2).value
'etc etc
end sub