rubberduck-vba / RubberduckWeb

Project Website for the Rubberduck VBA Editor Add-In
19 stars 12 forks source link

Indenter issue - IF Else inside a Select Case not aligning correctly #41

Closed rdster closed 7 years ago

rdster commented 7 years ago

I have an If with multiple ElseIfs inside of a Select Case inside of a For loop.

The Indenter is mis-aligning the ElseIfs and everything else below with Case. The actual code is much longer, but I think this reflects the issue. Below is the code after running the Indenter...

 For CurrentRow = 9 To MaxRows - 1
     Select Case .Cells(CurrentRow, "A")
       Case "[b]", "[f]", "[h]", "[t]"
         'Not a data row - skip
       Case "fMTCnty"
         'Do Stuff
       Case Else              
         If Mid(ReportName, 3, 1) = "r" Then
         iMult = -1      
       ElseIf ReportName = "SRadj" Or ReportName = "SRoth" Then
         iMult = -1
       ElseIf ReportName = "RBbarr" Then
         iMult = -1            
       Else                                    
         iMult = 1
       End If
       wsData.Calculate
       'More Stuff
     End Select
 Next iRow
comintern commented 7 years ago

Hmmm... I'm getting this on my settings:

    For CurrentRow = 9 To MaxRows - 1
        Select Case .Cells(CurrentRow, "A")
        Case "[b]", "[f]", "[h]", "[t]"
            'Not a data row - skip
        Case "fMTCnty"
            'Do Stuff
        Case Else
            If Mid(ReportName, 3, 1) = "r" Then
                iMult = -1
            ElseIf ReportName = "SRadj" Or ReportName = "SRoth" Then
                iMult = -1
            ElseIf ReportName = "RBbarr" Then
                iMult = -1
            Else
                iMult = 1
            End If
            wsData.Calculate
            'More Stuff
        End Select
    Next iRow

Can you upload your rubberduck.config file? It's in \Users\You\AppData\Roaming\Rubberduck

comintern commented 7 years ago

@rdster - And I just noticed this was open against RubberduckWeb. This should be closed and re-opened on on the Rubberduck repo.

retailcoder commented 7 years ago

@rdster please confirm, are you running Rubberduck 2.0.11?