How do I get rid of the line numbers

azizrasul

Well-known Member
Joined
Jul 7, 2003
Messages
1,304
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
I have inherited a 2007 workbook where the code has line numbers. How do I get rid of them? Here's a snippet of the code.

Code:
Private Sub Workbook_Open()

    Dim bDirty As Boolean
    Dim s2009Dataworkbook As String

    'Set Global Variable
10  nReportingYear = Year(Now)
20  Select Case nReportingYear

        Case 2010
            ' Include data
30          bIncludedY2009 = True
40          bIncludedY2008 = True
50          s2009Dataworkbook = DSI_2009_DataTable_FileName
60      Case 2011
70          bIncludedY2009 = True
80          bIncludedY2008 = False
90          s2009Dataworkbook = DSI_2009_DataTable_FileName
100     Case Else
110         bIncludedY2009 = False
120         bIncludedY2008 = False
130         s2009Dataworkbook = "No Longer Required; data in Dimensions"
140 End Select
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Mike, I don't have a userform, so how would I amend the code to remove the line numbers?
 
Upvote 0
Just curious to know why does the code not error with line numbers in?
 
Upvote 0

Forum statistics

Threads
1,224,513
Messages
6,179,214
Members
452,895
Latest member
BILLING GUY

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