Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want the value of PONum to be inserted in the message box. I tried
writing it after reading past posts on the subject, but I get an error. Syntax error? 'Here's the code leading up the Msgbox: Dim PONum As String For i = 1 To 13 'This will check to make sure there is only 1 PO number on list. Worksheets("Official List").Activate If Me.Controls("TextBox" & i * 2 - 1).Text < "" Then PONum = Me.Controls("TextBox" & i * 2 - 1).Text CountPOtoValidate = Application.CountIf(Range("J:J"), PONum) If CountPOtoValidate < 1 Then MsgBox ("This record " & Range("PONum") & "does not exist on the list." & vbNewLine & _ "Please check the PO number you entered, and try again.") I'm assuming I have to put quotes around PONum, right? Anything stand out to anyone??? Thanks for your help, J.O. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
That might work if there was a named range named POnum. Try this... MsgBox ("This record " & PONum & " does not exist on the list." & vbNewLine & _ "Please check the PO number you entered, and try again.") Given that ponu is a var set a few lines above. peter "excelnut1954" wrote: I want the value of PONum to be inserted in the message box. I tried writing it after reading past posts on the subject, but I get an error. Syntax error? 'Here's the code leading up the Msgbox: Dim PONum As String For i = 1 To 13 'This will check to make sure there is only 1 PO number on list. Worksheets("Official List").Activate If Me.Controls("TextBox" & i * 2 - 1).Text < "" Then PONum = Me.Controls("TextBox" & i * 2 - 1).Text CountPOtoValidate = Application.CountIf(Range("J:J"), PONum) If CountPOtoValidate < 1 Then MsgBox ("This record " & Range("PONum") & "does not exist on the list." & vbNewLine & _ "Please check the PO number you entered, and try again.") I'm assuming I have to put quotes around PONum, right? Anything stand out to anyone??? Thanks for your help, J.O. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wasn't sure about that part. This makes sense.
Thanks alot for the fast response. J.O. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There was 1 more thing. What is the syntax for getting the PONum to
show up on the nexr line by itself, then the rest can be under it. Also, can the PONum be in bold? Thank alot J.O. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Forget it... I searched some more in here, and see from a past post
that you can't selectively change the fonts in the message box. And, I got how to seperate the lines how I need them. Thanks J.O. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
msgBox sum values | Excel Discussion (Misc queries) | |||
Custom MsgBox using values from 2 different cells | Excel Programming | |||
format values in MsgBox? | Excel Programming | |||
Inserting values | Excel Programming | |||
Inserting values | Excel Programming |