#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 163
Default Excel 2003 + macro

I want to place some code at the start of my macro.

If D34 = no then a message box "Your printer code doesnt match" end macro
else yes run the macro.

Please help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Excel 2003 + macro

Hi,

Like this

Set sht = Sheets("Sheet1")
If UCase(sht.Range("D34")) = "NO" Then
MsgBox ("Your printer code doesn't match")
Exit Sub
End If

'Yuor code
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Neil Holden" wrote:

I want to place some code at the start of my macro.

If D34 = no then a message box "Your printer code doesnt match" end macro
else yes run the macro.

Please help.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 457
Default Excel 2003 + macro

If Range("D34").Value = "No" then
MsgBox "Your printer code doesn't match"
Exit Sub
End If

--
Best Regards,

Luke M
"Neil Holden" wrote in message
...
I want to place some code at the start of my macro.

If D34 = no then a message box "Your printer code doesnt match" end macro
else yes run the macro.

Please help.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Excel 2003 + macro

If UCase(Range("D34")) = "NO" Then
MsgBox "Your printer code doesnt match": Exit Sub
End If

'Rest of your macro

--
Jacob


"Neil Holden" wrote:

I want to place some code at the start of my macro.

If D34 = no then a message box "Your printer code doesnt match" end macro
else yes run the macro.

Please help.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 563
Default Excel 2003 + macro

Sub Somename()
If UCASE(Range("D4")) = "NO" Then
msgbox "Printer mismatch"
Exit Sub
End If

existing code
End Sub

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Neil Holden" wrote in message
...
I want to place some code at the start of my macro.

If D34 = no then a message box "Your printer code doesnt match" end macro
else yes run the macro.

Please help.


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
how to run acces 2003 macro in excell 2003 macro gonggo Excel Discussion (Misc queries) 0 October 6th 09 11:45 AM
Excel 2003 VBA Macro Partly Void[_2_] Excel Discussion (Misc queries) 1 July 6th 09 01:32 PM
Macro - Excel 2003 Dan Excel Discussion (Misc queries) 3 September 16th 08 08:28 PM
Help with a Macro - Excel 2003 Bob Smith Excel Worksheet Functions 3 June 19th 06 06:29 PM
macro in excel 2003 constance Excel Worksheet Functions 1 March 21st 05 09:50 AM


All times are GMT +1. The time now is 01:15 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"