help with loop and array

shabbyporpoise

New Member
Joined
Jul 22, 2011
Messages
26
hello Forum

I'm trying to create a vba program for work. I need to be able to read every element of 6 columns into an array and then be able to see if particular elements in each of these arrays match other lines. and so on for each row
Code:
Option Explicit

Sub mainFireWall()
    Dim num As Integer, names As String, i As Integer
    Dim colCount As Variant, rule(), allRules()
    Dim col As Integer
    Dim row As Integer
    Dim rowCount As Integer
    
    row = 1
    i = 1
    num = InputBox("how many rules are in this document?")
    For rowCount = 1 To num
        
        Do Until IsEmpty(Cells(row, i))
             ReDim Preserve rule(1 To i)
            rule(i) = Cells(1, i).Value
             i = i + 1
             row = row + 1      
        
            
         Loop
        
         MsgBox rule(3)
         
    Next rowCount
    

End Sub

thanks for any help you can provide forum

shabbyporpoise
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,224,613
Messages
6,179,896
Members
452,948
Latest member
Dupuhini

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