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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture the cell change 1

Status
Not open for further replies.

simoncpage

Programmer
Apr 4, 2002
256
GB
Hi all, wonder if anyone can help. I want to add in data validations to a row once the cell that starts the row has been changed. At present I am using the Worksheet_Change to capture this but the problem I have is that I am doing it so that it finds the last cell of that column and then adds in the validation for that row.

However the problem lies in the fact that if the cell above the last cell, for example, is altered this does not update the row for that cell (it updates the last row).

How can I capture the actual cell that has just been changed in order to applty formatting to the row it belongs to??

Any help would be most appreciated

Thanks
Simon
 
In worksheet change event, use the keyword Target to refer to the cell that has bee changed ie
Target.Value
Target.address etc

If Target.Column = 1 then (this is your 1st col in row)
mRow = Target.Row
mRow.Add Data validation >>>>> whatever the syntax is
Else
Don't add data validation
End if

would be the basic syntax from what I can gather
HTH
Geoff
 
This hasnt helped me directly but has lead me to another idea which works a treat, thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top