ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Which data have been entered into a cell ? (https://www.excelbanter.com/excel-programming/279542-data-have-been-entered-into-cell.html)

hglamy[_2_]

Which data have been entered into a cell ?
 
Hello there,

I need to react to the data that a user may enter into
certain cells (XL XP).

How can I programmatically catch the entry that has
been made ?

Help greatly appreciated.

Kind regards,

H.G. Lamy




Bob Phillips[_5_]

Which data have been entered into a cell ?
 
HG,

You need the Worksheet_Change event.

You test for what has been entered by testing the Target argument. For
instance, if you want to react to all changes in column N, use

If Target.Column = 14 Then

If you want to test for cells B5:G7 say, use

If (Not Intersect(Target,Range("B5:G7")) Is Nothing) Then

and then do your stuff.

As this is worksheet code, it goes into the worksheet code module.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"hglamy" wrote in message
...
Hello there,

I need to react to the data that a user may enter into
certain cells (XL XP).

How can I programmatically catch the entry that has
been made ?

Help greatly appreciated.

Kind regards,

H.G. Lamy






Chip Pearson

Which data have been entered into a cell ?
 
Use the Change event procedure in the Sheet's code module. E.g.,

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$A$1", "$B$2", "$C$3"
MsgBox "You changed one of these cells"
Case Else
MsgBox "You changed cell " & Target.Address
End Select
End Sub


--
Cordially,
Chip Pearson
Pearson Software Consulting, LLC
Microsoft MVP - Excel
www.cpearson.com


"hglamy" wrote in message
...
Hello there,

I need to react to the data that a user may enter into
certain cells (XL XP).

How can I programmatically catch the entry that has
been made ?

Help greatly appreciated.

Kind regards,

H.G. Lamy






hglamy[_2_]

Which data have been entered into a cell ?
 
Thank you !

I had tried to work with the "Selection_Change" event,
but with "Worksheet_Change" you pointed me to the right direction !

Kind regards,

H.G. Lamy


"hglamy" schrieb im Newsbeitrag
...
Hello there,

I need to react to the data that a user may enter into
certain cells (XL XP).

How can I programmatically catch the entry that has
been made ?

Help greatly appreciated.

Kind regards,

H.G. Lamy







All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com