Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing"


hello all.

I want to run a macro only:
if Field E10 = "WO ID" and AB10 = "Spec Sizing"

if field are different then it must show a message saying that the file is
not the correct one.

please help

Thanks
--
Lorenzo DÃ*az
Cad Technician
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing"

Maybe this,

Right click the sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("E10,AB10")) Is Nothing Then
If Range("E10").Value = "WO OD" And Range("AB10").Value = "Spec
Sizing" Then
MsgBox "Macro OK to go"
'do something
Else
MsgBox "wrong file"
End If
End If
End Sub

Mike

"ldiaz" wrote:


hello all.

I want to run a macro only:
if Field E10 = "WO ID" and AB10 = "Spec Sizing"

if field are different then it must show a message saying that the file is
not the correct one.

please help

Thanks
--
Lorenzo DÃ*az
Cad Technician

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing"


my macro needs Ctrl + m key to run,

and start llike this:

Sub Shipping()
' Keyboard Shortcut: Ctrl+m
'start Macro
Statement
'End macro
End Sub

where do I need to put your code?


--
Lorenzo DÃ*az
Cad Technician


"Mike H" wrote:

Maybe this,

Right click the sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("E10,AB10")) Is Nothing Then
If Range("E10").Value = "WO OD" And Range("AB10").Value = "Spec
Sizing" Then
MsgBox "Macro OK to go"
'do something
Else
MsgBox "wrong file"
End If
End If
End Sub

Mike

"ldiaz" wrote:


hello all.

I want to run a macro only:
if Field E10 = "WO ID" and AB10 = "Spec Sizing"

if field are different then it must show a message saying that the file is
not the correct one.

please help

Thanks
--
Lorenzo DÃ*az
Cad Technician

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
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Pivot Tables - How can I "reset" the selections in "Row Field"? shadestreet Excel Discussion (Misc queries) 3 April 24th 06 06:29 PM


All times are GMT +1. The time now is 01:49 AM.

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"