Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reacting to user updates in an individual cell 1

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
I would like to setup some default values for related cells when a user enters data for the first time in a given cell.
For example, say the first time they enter data in B2, I want to set the value in C2 and D2.

But I don't want to change C2 or B2 after the initial setup.
If I react to the sheetchange event, is there a property that exposes the value of the cell in question prior to the user update? If more than one cell is involved I will skip the processing.

Any ideas or suggestions? Thanks in advance.

Have a great day!
 
Can you use formulas to call your own functions from a module?

C2 -> formula --> =SBendsFunction1(B2)

HTH

;P
 
(in regular module)
public WasEmpty as boolean

(in worksheet code module)
sub worksheet_selectionchange(...)
if target.count>1 then WasEmpty=false else WasEmpty=target=""
end sub

sub worksheet_change(...)
if target.column=2 and target.count=1 and WasEmpty then
...put stuff in columns C and D
end if
end sub Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top