Hi all,
I isolated my issue to the following piece of code
It basically opens another workbook and gives the first non-empty cell from column jj
In short, this part of the code:
- Does not work as it is.
- Works when no external workbook is involved (It looks in the same worksheet than the macro)
- Works if I replace Range(Cells(1, jj), Cells(Rows.Count, jj)) and After:=Cells(1, jj) for Range("E:E") and Range("E1"), respectively.
This last option is less than ideal since I need to loop through different columns in an specific order.
Anyone knows what might be the issue?
Regards,
I isolated my issue to the following piece of code
VBA Code:
Dim MetOceanWorkbook As Workbook
Dim MetOceanSheet As Worksheet
Dim RowIni, InputNcol as Variant
Application.ScreenUpdating = False
Set TWorkbook = Workbooks.Open(Path & "\" & "T.xlsx")
Set TSheet = TWorkbook.Worksheets.Item(2)
For jj = InputNcol(0) + ii * 4 To InputNcol(2) + ii * 4
RowIni = TSheet.Cells.Range(Cells(1, jj), Cells(Rows.Count, jj)).Find(What:="*", _
After:=Cells(1, jj), LookAt:=xlWhole, LookIn:=xlValues, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Row
Next
It basically opens another workbook and gives the first non-empty cell from column jj
In short, this part of the code:
- Does not work as it is.
- Works when no external workbook is involved (It looks in the same worksheet than the macro)
- Works if I replace Range(Cells(1, jj), Cells(Rows.Count, jj)) and After:=Cells(1, jj) for Range("E:E") and Range("E1"), respectively.
This last option is less than ideal since I need to loop through different columns in an specific order.
Anyone knows what might be the issue?
Regards,