How do I update the following code and any code to work between 2 files. I will run the program from the original document (called "Rundw") within sheet1. I need to move sheets 11 - 14 to another file called "Run_database"
"For i = 11 To 14
Set rng = Sheets("Sheet " & i).Range(rngArray(i - 11))"
Sub test2()
Dim r As Range, c As Range, rngArray, Data As Range, rng As Range
Dim i As Integer, ii As Integer
Set Data = Sheets("sheet1").Range("ck133:dt144")
rngArray = Array("D5:IT7", "D5:IT28", "D5:IT144", "D5:IT645")
For i = 11 To 14
Set rng = Sheets("Sheet " & i).Range(rngArray(i - 11))
For ii = 1 To rng.Columns.Count Step 2
For Each r In rng.Columns(i)
Set c = Data.Find(what:=r.Value, looat:=xlWhole)
If Not c Is Nothing Then r.Offset(, 1) = r.Offset(, 1) + 1
Next
Next
Next
End Sub
Here is the same reference from another code that needs to be updated the way
"a = Sheets("sheet " & 11 + n).Range(rngArray(n)).Value"
Bookmarks