Code:Dim ex As Excel.Application Dim wb As Excel.Workbook Dim sh As Excel.Worksheet, i As Long Set ex = New Excel.Application Set wb = ex.Workbooks.Open("C:\wb1.xls") Set sh = wb.Worksheets(1) With sh.UsedRange For i = .Row To .Row + .Rows.Count - 1 sh.Cells(i, .Column + .Columns.Count) = "CATATAN" Next End With wb.Save Set sh = Nothing wb.Close Set wb = Nothing ex.Application.Quit Set ex = Nothing




Reply With Quote