Edit Clear contents of cells in CommonSheet to sheet name

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. 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.?
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
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I have found a old copy of the above application after which a lot of editing is done. I will work on that tomorrow and post the portion which I will not be able to edit.
 
Upvote 0
Which one do you need? The one with the two buttons to generate master xml & generate purchases xml?
 
Upvote 0
Which one do you need? The one with the two buttons to generate master xml & generate purchases xml?
Actually there are 3 buttons - Check & Match Headings, Generate Master XML and Generate Purchase XML If the headings are corrected it takes less than a minute to get both the xml files.
 
Upvote 0
I don't recall that one. Is that something I would have? If so, do you know what it was called?
 
Upvote 0
Please check today's query. I will get confused if I work on 2 things at a time. I have been working on the bank statement the whole day and you can ask me about it.
Please refer post #3

Code not to resize if count is 1​

 
Upvote 0
I will work on the purchases tomorrow morning and by this time tomorrow night I will share the file with you.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top