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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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