I am trying to create a loop through specifc sheets and colums which are linked specifically, but this doesn't work, am I misunderstanding how to use arrays?
Sub test()
Dim wb As Workbook, big, rc, sr As Worksheet, rejcheck, copyto, arr As variant
Set wb = ActiveWorkbook
Set big = wb.Sheets("BIG")
Set oou = wb.Sheets("OOU")
Set sr = wb.Sheets("SR")
rejcheck = Array(big, sr, oou)
copyto = Array(47, 23, 58)
arr = Array(rejcheck, copyfrom)
For Each x In arr
With rejcheck
.Range("a2").Copy wb.Sheets("other sheet").Cells(1, copyto)
wb.Sheets("other sheet").Cells(1, copyto).Offset(0, 1).Value = .Name
End With
Next x
End Sub
basically I want loop in a parallel fashion through these associated values ((big, 47),(sr,23),(oou,58)) having the first as the source sheet and the second the column number of a target sheet.
any help?
Option Explicitat the top, it will give you so many errors in your code.