![]() |
#1
|
|||
|
|||
![]()
As our small team learns VBA, we get a lot of info from the folks on this forum and their websites. I like to understand every line of code, and not blindly copy/paste from the internet.
As I review several of our scripts, I keep seeing this "lbl_Exit:" From my Windows cmd scripting, this looks like it may be the target for a GOTO command? But I'm seeing it just listed in the script with nothing else pointing to it. Which I'm guessing will just run the commands under this label when it appears in the script. Can someone explain what this is about, or where I can learn more about it, and even if I need it at all? Here's is one of several similar scripts we've created that uses lbl_Exit: But nothing in the script calling it. I'm guessing setting a variable to Nothing clears it, which seems like a good thing to do. Not sure if that is necessary, as Exit Sub and End Sub would probably do that anyways, right? Code:
Sub bhh_removeCrossRefs() ' Do what Ctrl shift F9 does, removing cross-references. Dim i as Integer Dim oStory As Range For Each oStory In ActiveDocument.StoryRanges For i = oStory.Fields.Count To 1 Step -1 If oStory.Fields(i).Type = wdFieldNoteRef Then Debug.Print (oStory.Fields(i).Type) oStory.Fields(i).Unlink End If Next i Next oStory lbl_Exit: Set oStory = Nothing Exit Sub End Sub ' bhh_removeCrossRefs |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Chayes | Excel Programming | 8 | 06-05-2018 07:19 AM |
![]() |
Flobiwan | Office | 2 | 04-23-2017 04:27 AM |
Button does not generate proper colors? | cloudforgiven | Excel | 10 | 12-22-2016 09:57 PM |
proper | snoforlife | Excel Programming | 0 | 01-26-2016 02:16 PM |
Proper Text Format | sufian,naeem | Excel | 1 | 05-05-2014 05:59 AM |