RAJESH1960
Banned for repeated rules violations
- Joined
- Mar 26, 2020
- Messages
- 2,313
- Office Version
- 2019
- Platform
- Windows
Hi, I have created a Macro to Generate XML. It will select the data from Sheet1 from cellA2. If cell A2 is blank then too message is displayed as XML generated
I want to add a code inbetween where if cell A2 is blank it should display a message box “Data Not Entered". and should not generate XML until data is entered
Sub SaveASPurchaseXML()
Dim rngData As Range
Dim strData As String
Dim strTempFile As String
Dim x As Long, y As Long
Dim usr As String
y = Sheets("Sheet2").Range("A2").CurrentRegion.Columns.Count
x = Sheets("Sheet1").Range("A2:A" & Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row).Rows.Count
Range("A2").Resize(x, y).Copy
I want to add a code inbetween where if cell A2 is blank it should display a message box “Data Not Entered". and should not generate XML until data is entered
Sub SaveASPurchaseXML()
Dim rngData As Range
Dim strData As String
Dim strTempFile As String
Dim x As Long, y As Long
Dim usr As String
y = Sheets("Sheet2").Range("A2").CurrentRegion.Columns.Count
x = Sheets("Sheet1").Range("A2:A" & Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row).Rows.Count
Range("A2").Resize(x, y).Copy