Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Lista Forumurilor Pe Tematici
|
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login
POZE MRRRR'S FORUM (VIEW ONLY)
Nu sunteti logat.
|
Nou pe simpatie: catalina5
 | Femeie 19 ani Bucuresti cauta Barbat 30 - 46 ani |
|
TRaP
Moderator
Inregistrat: acum 7 ani
Postari: 806
|
|
You can have the following code in a module in personal.xlsb and when you press the button it will remove any code that you have in the active workbook. This is useful in case you want to use row auto-highlighting when cell is selected, but don't want to save a macro enabled file, but with a normal xls/xlsx file. Then first you run the code below using your QAT button so your worksheet is clean of VBA, then save like you normally do.
Sub Z_3RemoveVBAinActiveSheetCode()
Dim activeIDE As Object 'VBProject Set activeIDE = ActiveWorkbook.VBProject
Dim Element As VBComponent
Dim LineCount As Integer For Each Element In activeIDE.VBComponents If Left(Element.Name, 5) = "Sheet" Then 'change name if necessary LineCount = Element.CodeModule.CountOfLines Element.CodeModule.DeleteLines 1, LineCount End If Next
End Sub |
Works with:
Modificat de TRaP (acum 6 ani)
|
|
pus acum 6 ani |
|