ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel 2003 + macro (https://www.excelbanter.com/excel-discussion-misc-queries/258908-excel-2003-macro.html)

Neil Holden

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.

Mike H

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.


Luke M[_4_]

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.




Jacob Skaria

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.


Bernard Liengme[_2_]

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.




All times are GMT +1. The time now is 05:07 PM.

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