Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Validation Cell Macro

I have a List where we are updating the material received to our stock,
The list contais a coulum with validation cell where we input ( Order Short,
Order Complete)

i want the macro to activate when each cell in the coulum changes,

Example,

If cell H2 is updated Order complete "do nothing"
if cell h3 is updated Order Short "Run Macro"


Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Validation Cell Macro

You could use a worksheet_change event:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("H2:H100")) Is Nothing Then
Exit Sub
End If

Select Case LCase(Target.Value)
Case Is = LCase("Order Short")
Call RunMacroNameHere
Case Else
'do nothing
End Select

End Sub

If you want to try...

Rightclick on the worksheet tab that should have this behavior. Select view
code and paste this into the code window.

Remember to change H2:H100 to the range you want.

You can read more about events at:
Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

If you're sharing the workbook with people using xl97, you may want to read
Debra Dalgleish's notes:
http://contextures.com/xlDataVal08.html#Change


MESTRELLA29 wrote:

I have a List where we are updating the material received to our stock,
The list contais a coulum with validation cell where we input ( Order Short,
Order Complete)

i want the macro to activate when each cell in the coulum changes,

Example,

If cell H2 is updated Order complete "do nothing"
if cell h3 is updated Order Short "Run Macro"

Thanks


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Validation Cell Macro

OK Thanks,

I saw this macro in your web page but I still do not undurstand the "Target
Value" or i am doing somting wrong because i still can't get it to run.

I Copied the macro as it Is, Istalled a MsgBox as the Macro just to test but
it would not run Yet.

what am I doing wrong. As you can see a have not change a lot

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("H2:H100")) Is Nothing Then
Exit Sub
End If

Select Case LCase(Target.Value)
Case Is = LCase("Order Short")
Call RunMacroNameHere
Case Else
MsgBox ("AQUI!")

End Select

End Sub




"Dave Peterson" wrote:

You could use a worksheet_change event:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("H2:H100")) Is Nothing Then
Exit Sub
End If

Select Case LCase(Target.Value)
Case Is = LCase("Order Short")
Call RunMacroNameHere
Case Else
'do nothing
End Select

End Sub

If you want to try...

Rightclick on the worksheet tab that should have this behavior. Select view
code and paste this into the code window.

Remember to change H2:H100 to the range you want.

You can read more about events at:
Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

If you're sharing the workbook with people using xl97, you may want to read
Debra Dalgleish's notes:
http://contextures.com/xlDataVal08.html#Change


MESTRELLA29 wrote:

I have a List where we are updating the material received to our stock,
The list contais a coulum with validation cell where we input ( Order Short,
Order Complete)

i want the macro to activate when each cell in the coulum changes,

Example,

If cell H2 is updated Order complete "do nothing"
if cell h3 is updated Order Short "Run Macro"

Thanks


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Validation Cell Macro

Did you put it behind the correct worksheet?

Did you make a change to something in H2:H100?

Did you read the notes about events and data|validation at Debra Dalgleish's
site (if you're running xl97)?



MESTRELLA29 wrote:

OK Thanks,

I saw this macro in your web page but I still do not undurstand the "Target
Value" or i am doing somting wrong because i still can't get it to run.

I Copied the macro as it Is, Istalled a MsgBox as the Macro just to test but
it would not run Yet.

what am I doing wrong. As you can see a have not change a lot

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("H2:H100")) Is Nothing Then
Exit Sub
End If

Select Case LCase(Target.Value)
Case Is = LCase("Order Short")
Call RunMacroNameHere
Case Else
MsgBox ("AQUI!")

End Select

End Sub

"Dave Peterson" wrote:

You could use a worksheet_change event:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("H2:H100")) Is Nothing Then
Exit Sub
End If

Select Case LCase(Target.Value)
Case Is = LCase("Order Short")
Call RunMacroNameHere
Case Else
'do nothing
End Select

End Sub

If you want to try...

Rightclick on the worksheet tab that should have this behavior. Select view
code and paste this into the code window.

Remember to change H2:H100 to the range you want.

You can read more about events at:
Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

If you're sharing the workbook with people using xl97, you may want to read
Debra Dalgleish's notes:
http://contextures.com/xlDataVal08.html#Change


MESTRELLA29 wrote:

I have a List where we are updating the material received to our stock,
The list contais a coulum with validation cell where we input ( Order Short,
Order Complete)

i want the macro to activate when each cell in the coulum changes,

Example,

If cell H2 is updated Order complete "do nothing"
if cell h3 is updated Order Short "Run Macro"

Thanks


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
insert date Larry Excel Worksheet Functions 28 July 15th 06 02:41 AM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro help thephoenix12 Excel Discussion (Misc queries) 4 July 15th 05 05:57 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM


All times are GMT +1. The time now is 02:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"