Posts by dangelor

    Possibly...

    Possibly...

    I assume that TglOrderMasuk and the others are single cell named ranges of the column headers. If so, to use them you need to extract the range's column to use it in the format you have shown.


    Code
    With Worksheets("ListItem")
        n = .Cells(Rows.Count, .Range("TglOrderMasuk").Column).End(xlUp).Row + 1
        .Cells(n, .Range("TglOrderMasuk").columnn).Value = txbOrderMasuk.Value
        '...
        '... and so on.
    End With

    Better would to just use the column's number...


    Code
    With Worksheets("ListItem")
        n = .Cells(Rows.Count, 2).End(xlUp).Row + 1
        .Cells(n, 2).Value = txbOrderMasuk.Value
        '...
        '... and so on.
    End With

    Can't tell the players without a scorecard... As Mumps said earlier, post your workbook and code.


    I ran the code on a test file of over 600K rows and 1 column. No problems. Run time was less than 3 seconds.

    Try this version...

    Try...

    Added the dash...

    Can I skip 6-11 lines of the code as it is taking lot of time and the excel I have has 80k rows

    I see you've moved on , but this is a reply to post #15. It may be a little quicker...

    Quote

    ...is there any way to record stock symbols (lets say somewhere in the column M) that cause errors because their corresponding files do not exist in the folder? ...


    Try changing the if statement to...

    Code
                    If Not wb Is Nothing Then         'IF FILE EXISTS THEN
                        wb.ActiveSheet.Range("B2").Insert Shift:=xlShiftDown 
                        wb.Close True
                    Else
                        cell.Offset(, 2).Value = "File not found for " & cell.Value
                    End If