Hi,
<-- It's my first post on forum
I was reading about INDIRECT function but can't figure it out.
I have following code:
<CODE>
Sub try()
Dim x As Integer
For x = 1 To 1000
If Worksheets("Sheet1").Cells(x, 1).Value <> "" Then
Worksheets("Sheet1").Cells(x, 2).Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],'[Transport_WK7.xls]aaa'!C1:C12,2,0)"
Else: End If
Next x
End Sub
</CODE>
Workbook "TransportWK x " changes name every week and I want this code to get information about week number (bolded red) from workbook where macro is runned, let say from cell A1
Is it possible to use INDIRECT in this case, any other ideas?
Many Thanks,
<-- It's my first post on forum
I was reading about INDIRECT function but can't figure it out.
I have following code:
<CODE>
Sub try()
Dim x As Integer
For x = 1 To 1000
If Worksheets("Sheet1").Cells(x, 1).Value <> "" Then
Worksheets("Sheet1").Cells(x, 2).Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],'[Transport_WK7.xls]aaa'!C1:C12,2,0)"
Else: End If
Next x
End Sub
</CODE>
Workbook "TransportWK x " changes name every week and I want this code to get information about week number (bolded red) from workbook where macro is runned, let say from cell A1
Is it possible to use INDIRECT in this case, any other ideas?
Many Thanks,