Remove lines from VBA procedure

Remove lines from VBA procedure


Sub Remove_Lines()

'Dim iNumber%     'Integer
'Dim lAverage&    'Long
'Dim sngTotal!    'Single
'Dim dbTotal#     'Double
'Dim cProfit@     'Currency
'Dim sFirstName$  'String
'Dim llDiscount^  'LongLong on 64 bit

'declare variables
Dim lines&, i&  '& is the shortcut for Long type. see above for other shortcuts.
    'count lines of the "WaterFall_Graph" module
    lines = ThisWorkbook.VBProject.VBComponents.Item("WaterFall_Graph").CodeModule.CountOfLines

On Error Resume Next
'loop through each line
For i = 1 To lines
    'delete line one by one from the module
    ThisWorkbook.VBProject.VBComponents.Item("WaterFall_Graph").CodeModule.DeleteLines 1
Next i

End Sub

एक टिप्पणी भेजें

0 टिप्पणियाँ