RAJESH1960
Banned for repeated rules violations
- Joined
- Mar 26, 2020
- Messages
- 2,313
- Office Version
- 2019
- Platform
- Windows
Hello JohnnyL,
When I press the first button Generate Master xml. there are 3 rows in Import masters sheet. When I press the second button Generate Purchase xml it deletes all the rows except the first which it doesn't as it is not at all connected to purchase xml. The good thing the master xml has generated 3 rows of data and saved it on the desktop but the question is why is it deleting the data. Is the common sheet code connected to both master and purchase codes? Can you edit the code from deleting the data in the Import Master sheet.?
When I press the first button Generate Master xml. there are 3 rows in Import masters sheet. When I press the second button Generate Purchase xml it deletes all the rows except the first which it doesn't as it is not at all connected to purchase xml. The good thing the master xml has generated 3 rows of data and saved it on the desktop but the question is why is it deleting the data. Is the common sheet code connected to both master and purchase codes? Can you edit the code from deleting the data in the Import Master sheet.?
Rich (BB code):
Sub ClearCommonDataFromSheet(CommonSheet As Worksheet)
'
Dim LastRowInCommonSheet As Long
Dim LastColumnLetterCommonSheet As String
'
With CommonSheet
LastColumnLetterCommonSheet = Split(Cells(1, (.Cells.Find("*", _
, xlFormulas, , xlByColumns, xlPrevious).Column)).Address, "$")(1) ' Get last column letter used in CommonSheet
LastRowInCommonSheet = .Cells.Find("*", , xlFormulas, , xlByRows, xlPrevious).Row ' Find last row # used in CommonSheet
.Range("A3:" & LastColumnLetterCommonSheet & LastRowInCommonSheet + 1).ClearContents ' Clear contents of cells in CommonSheet
End With
End Sub