VBA Convert from Array to Non-Array

rsmeyerson

Board Regular
Joined
Nov 29, 2014
Messages
104
I'm looking for some help converting code from array to non-array. I was using Lbound to Ubound with the array. Can you please help adjust this code so that it works in this new format? Thanks for your help with this.

Code:
    If sh.Name = "Closer" Or sh.Name = "Mario" Or sh.Name Like "Fin*" Then        With sh
        For i = LBound To UBound
        'With Worksheets(wSht(i))
            .Columns("E").Insert
            .Columns("F").Copy .Columns("E")
            .Columns("E").Replace "New Total", "#N/A"
            On Error Resume Next
            For Each c In .Columns("E").SpecialCells(2, xlErrors)
                c.Offset(1, 0).PageBreak = xlPageBreakManual
            Next c
            .Columns("E").Delete
        'End With
        On Error GoTo 0
        Next i
        Application.ScreenUpdating = True
        End With
    End If
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
If you take out the For .. Next loop, i.e. the two lines:

Code:
For i = ...
Next i

does your code do what you want it to?
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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