This was my original post:
Here is the basic idea....
A
7 N
8
9
10
11
12
The possible values to be entered are N,S,E,W. I want to create a formula that when A8 is highlighted it enters the appropriate value(N,S,E,W) into A8. In this case N. When A9 is highlighted it would automatically enter N. If the user were to change the value of A9 to S, then when A10 was highlighted "S" would automatically be entered...and so on...and so on....
I received the following code from RobBroekhuis(TechnicalUser)
Apr 4, 2003
Use worksheet events, something like:
dim CurrentDirection as string
sub worksheet_selectionchange
if target.column=1 and target="" then '(an empty cell in column A)
target=CurrentDirection
end if
end sub
sub worksheet_change
if target.column=1 and instr("NSEW",target)>0 then
CurrentDirection=target
end if
end sub
I inserted this as worksheet event code but I'm receiving compile errors. I'm not sure what is wrong. Can anyone provide some guidance. Any help would be much appreciated.
Thanks,
Brent
Here is the basic idea....
A
7 N
8
9
10
11
12
The possible values to be entered are N,S,E,W. I want to create a formula that when A8 is highlighted it enters the appropriate value(N,S,E,W) into A8. In this case N. When A9 is highlighted it would automatically enter N. If the user were to change the value of A9 to S, then when A10 was highlighted "S" would automatically be entered...and so on...and so on....
I received the following code from RobBroekhuis(TechnicalUser)
Apr 4, 2003
Use worksheet events, something like:
dim CurrentDirection as string
sub worksheet_selectionchange
if target.column=1 and target="" then '(an empty cell in column A)
target=CurrentDirection
end if
end sub
sub worksheet_change
if target.column=1 and instr("NSEW",target)>0 then
CurrentDirection=target
end if
end sub
I inserted this as worksheet event code but I'm receiving compile errors. I'm not sure what is wrong. Can anyone provide some guidance. Any help would be much appreciated.
Thanks,
Brent