【Excel VBA】關閉螢幕更新
Application.ScreenUpdating = False
'xxxxxxxxxxxxxxxx
Application.ScreenUpdating = True
【Excel VBA】開一個新的sheet
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Name = "XXXXX"
'xxxxxxxxxxxx
'【Excel VBA】關掉最sheet
Application.DisplayAlerts = False
Sheets("XXXXX").Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
'AutoFit All Columns on Worksheet
ThisWorkbook.Worksheets("xxxxxxx" ).Cells.EntireColumn.AutoFit
'【Excel VBA】調整一下表格大小
ThisWorkbook.Worksheets("xxxxxxx" ).Columns.ColumnWidth = 10
ThisWorkbook.Worksheets("xxxxxxx" ).Rows.RowHeight = 30
ThisWorkbook.Worksheets("xxxxxxx" ).Columns("E").ColumnWidth = 50
'【Excel VBA】取得當下的row 數 column 數
DataRange = Worksheets("xxxxx").Cells(Worksheets("xxxxx").Rows.Count, "A").End(xlUp).Row '包含空白!! 用這個
LastColumn = Worksheets("xxxxx").UsedRange.Columns(Worksheets("xxxxx").UsedRange.Columns.Count).Column
'【Excel VBA】複製A 的第 i+row 到 B的 k+1 row
Worksheets("A").Rows(i + 1).EntireRow.Copy
Worksheets("B").Range("A" & k + 1).Select
Worksheets("B").Paste
沒有留言:
張貼留言