Hello,
I'm having some difficulties in changing the below vba code which returns a message based on the text in column E, F and G .
The columns are normally numeric so how would i go changing the below code to say if there are non-numeric values, flag this up in the message box?
Many thanks and look forward to hearing any solutions.
Regards
MS
Sub WarningMac()
Dim res As VbMsgBoxResult
Dim instancesO As Long
Dim instancesP As Long
instancesE = WorksheetFunction.CountIf(Columns("E"), "#N/A N/A")
instancesF = WorksheetFunction.CountIf(Columns("F"), "#N/A N/A")
instancesG = WorksheetFunction.CountIf(Columns("G"), "#N/A N/A")
Datestamp = Format(Sheets("SECURITIES").Range("C1"), "ddmmyyyy")
Path = "S:\12PM\"
Filename = " China A Shares Midday"
res = MsgBox(Prompt:="Archive File to be saved as " & Datestamp & Filename & ".xlsx" & vbNewLine & vbNewLine & _
"Found " & instancesE & " Error(s). Please input price on BID" & vbNewLine & vbNewLine & _
"Found " & instancesF & " Error(s). Please input price on ASK" & vbNewLine & vbNewLine & _
"Found " & instancesG & " Error(s). Please input FX rate" & vbNewLine & vbNewLine & _
"Check CELL C1 is correct for ,todays 12PM Pricng Point", Buttons:=vbYesNo + vbExclamation, Title:="China A Shares Midday File")
If res = vbNo Then
MsgBox "File NOT Archived"
Exit Sub
End If
I'm having some difficulties in changing the below vba code which returns a message based on the text in column E, F and G .
The columns are normally numeric so how would i go changing the below code to say if there are non-numeric values, flag this up in the message box?
Many thanks and look forward to hearing any solutions.
Regards
MS
Sub WarningMac()
Dim res As VbMsgBoxResult
Dim instancesO As Long
Dim instancesP As Long
instancesE = WorksheetFunction.CountIf(Columns("E"), "#N/A N/A")
instancesF = WorksheetFunction.CountIf(Columns("F"), "#N/A N/A")
instancesG = WorksheetFunction.CountIf(Columns("G"), "#N/A N/A")
Datestamp = Format(Sheets("SECURITIES").Range("C1"), "ddmmyyyy")
Path = "S:\12PM\"
Filename = " China A Shares Midday"
res = MsgBox(Prompt:="Archive File to be saved as " & Datestamp & Filename & ".xlsx" & vbNewLine & vbNewLine & _
"Found " & instancesE & " Error(s). Please input price on BID" & vbNewLine & vbNewLine & _
"Found " & instancesF & " Error(s). Please input price on ASK" & vbNewLine & vbNewLine & _
"Found " & instancesG & " Error(s). Please input FX rate" & vbNewLine & vbNewLine & _
"Check CELL C1 is correct for ,todays 12PM Pricng Point", Buttons:=vbYesNo + vbExclamation, Title:="China A Shares Midday File")
If res = vbNo Then
MsgBox "File NOT Archived"
Exit Sub
End If