UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Closed TopicStart new topic
> Vbe Module And Line Deletion, Any Version    
 
   
Barada
post Apr 22 2019, 04:22 AM
Post#1



Posts: 14
Joined: 3-February 11



hello I have a code that I use to delete a line in my modules and I would like to modify it to delete a line block.
Departure on the front line: ExitSub:
End of line: End Sellect
Here is my code
thank you in advance for the correction
Best regards
CODE
Public Function SET_VBE_Del_Gerreur_Mod_1()
    Dim N As Long
    Dim S As String
    Dim LineCount As Long
    Dim vbProj As VBProject
    Dim vbMod As CodeModule
    Dim VBComp As VBComponent
    For Each vbProj In Application.VBE.VBProjects        
        For Each VBComp In vbProj.VBComponents            
            Set vbMod = VBComp.CodeModule
            With VBComp.CodeModule
                For N = .CountOfLines To 1 Step -1
                    S = .Lines(N, 1)
                    If Right(LTrim(S), 6) = "ErrSub" Then
                        .DeleteLines N
                    ElseIf Right(Trim(S), 6) = "ErrSub" Then
                        ' commentez la ligne, sautez-la
                    Else
                        LineCount = LineCount + 1
                    End If
                Next N
            End With
        Next VBComp
    Next vbProj
    Set vbMod = Nothing
    Debug.Print LineCount - 1
End Function

Go to the top of the page
 
isladogs
post Apr 22 2019, 05:27 AM
Post#2


UtterAccess VIP
Posts: 1,607
Joined: 4-June 18
From: Somerset, UK


Cross posted here at UA https://www.UtterAccess.com/forum/index.php...2053496&hl=

--------------------
Go to the top of the page
 
Barada
post Apr 22 2019, 09:31 AM
Post#3



Posts: 14
Joined: 3-February 11



Hello
I did not find the way to close it that's why I created another post to dissociate them
best regards
Go to the top of the page
 
isladogs
post Apr 22 2019, 09:38 AM
Post#4


UtterAccess VIP
Posts: 1,607
Joined: 4-June 18
From: Somerset, UK


Why is this in the macros forum anyway?
Its utterly pointless creating two identical threads. In fact its disapproved of and I would recommend mods delete this thread.
This post has been edited by isladogs: Apr 22 2019, 09:39 AM

--------------------
Go to the top of the page
 
Barada
post Apr 23 2019, 02:55 AM
Post#5



Posts: 14
Joined: 3-February 11



Hello
I think that it is two different approaches speaking of block of lines, the one text file, the other of the VBD, but if it must not be in the macros, it can be deleted it suits me
best regards
Go to the top of the page
 
theDBguy
post Apr 23 2019, 08:15 AM
Post#6


Access Wiki and Forums Moderator
Posts: 76,316
Joined: 19-June 07
From: SunnySandyEggo


This thread has been locked. It will be deleted shortly. Please continue the discussion in the original thread. Thank you.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th September 2019 - 09:50 PM