Hi All,
I am fairly new to VBA and for the life of me I cannot figure out how to have variable text show up in a MsgBox. The code I have so far is:
Basically what this Macro does is looks at the date in column J and then triggers a different border colors based on the current date. With the date in column J being tomorrow scenario; I am trying to get the MsgBox to pop up with the "Please Note: There is a Formal Document Due Tomorrow For" & then pull the text (company name) from the corresponding row in Column K.
Thanks in Advance
I am fairly new to VBA and for the life of me I cannot figure out how to have variable text show up in a MsgBox. The code I have so far is:
Code:
Dim a As Integer
Dim b As Integer
Dim [COLOR="Red"]strg[/COLOR] As String
strg = Range("C2").Offset(a, 0).Value
For a = 0 To 1500
If Range("J2").Offset(a, 0).Value < Now() Then
Range("J2").Offset(a, 0).Interior.Color = RGB(192, 224, 255)
End If
If Range("J2").Offset(a, 0).Value > Now() Then
Range("J2").Offset(a, 0).Interior.Color = RGB(0, 255, 0)
End If
If Range("J2").Offset(a, 0).Value = Date Then
Range("J2").Offset(a, 0).Interior.Color = RGB(255, 255, 0)
End If
If Range("J2").Offset(a, 0).Value = Date + 1 Then
Range("J2").Offset(a, 0).Interior.Color = RGB(255, 0, 0)
MsgBox ("There is a RFQ Due Tomorrrow")
If Range("K2").Offset(a, 0).Font.Name = "Wingdings" Then
[COLOR="red"]MsgBox ("Please Note: There is a Formal Document Due Tomorrow For" & "strg")[/COLOR]
End If
End If
Next a
End Sub
Basically what this Macro does is looks at the date in column J and then triggers a different border colors based on the current date. With the date in column J being tomorrow scenario; I am trying to get the MsgBox to pop up with the "Please Note: There is a Formal Document Due Tomorrow For" & then pull the text (company name) from the corresponding row in Column K.
Thanks in Advance