'Stop running script if blank
My code is as follows:
Sub Batchcreate()
Dim Session As Object
Dim r As Integer
Set Session = SAPFindSession("Cobalt - Z2L (Prod)", useAutoLogon:=False)
'Set Session = SAPFindSession("Cobalt - ZHL (Cons)", useAutoLogon:=False)
For r = 1 To WorksheetFunction.CountA(Columns(1))
Session.findById("wnd[0]/tbar[0]/okcd").Text = "/nmsc1n"
Session.findById("wnd[0]").sendVKey 0
'SAP article number
Session.findById("wnd[0]/usr/subSUBSCR_BATCH_MASTER:SAPLCHRG:1111/subSUBSCR_HEADER:SAPLCHRG:1401/ctxtDFBATCH-MATNR").Text = Cells(r, 1)
Next r
End Sub
Excel looks like this:
A1: 12345
A2: 12438
A3: 15463
A4: 15436
A5: _______
A5 is blank, the script continues to try to run even when cell is blank. Can you suggest how to stop script if Cell is blank?
Thank you in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
