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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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