Sub deletesheets()
    Application.DisplayAlerts = False
    Worksheets("Sheet3").delete
    Application.DisplayAlerts = Ture
End Sub


Sub deletesheets2()
    Application.DisplayAlerts = False
    Sheets(Sheets.Count).delete
    Application.DisplayAlerts = True
End Sub

 

'Tools > Excel VBA' 카테고리의 다른 글

delete sheets  (0) 2015.11.27
add sheet  (0) 2015.11.27
copy cell  (0) 2015.11.27
by TrafficYoon 2015.11.27 16:51

Sub addnewsheets()
    Worksheets.Add before:=Sheets(1)
    Worksheets.Add after:=Worksheets("Sheet3")
    Worksheets.Add after:=Sheets(Sheets.Count)
End Sub

'Tools > Excel VBA' 카테고리의 다른 글

delete sheets  (0) 2015.11.27
add sheet  (0) 2015.11.27
copy cell  (0) 2015.11.27
by TrafficYoon 2015.11.27 16:00

Sub copy()
    Worksheets("Sheet1").Activate
   
    Range("A1").CurrentRegion.copy
       
    Worksheets("Sheet2").Activate
   
    Range("A1").PasteSpecial
    Range("A1").PasteSpecial xlPasteColumnWidths
  
End Sub

Sub copy2()
    Worksheets("Sheet1").Activate
   
    Range("A1").CurrentRegion.copy Worksheets("Sheet2").Range("A1")
   
    Worksheets("Sheet2").Activate
   
    'Columns("B:C").AutoFit
    Range("B:C").EntireColumn.AutoFit
   
End Sub

'Tools > Excel VBA' 카테고리의 다른 글

delete sheets  (0) 2015.11.27
add sheet  (0) 2015.11.27
copy cell  (0) 2015.11.27
by TrafficYoon 2015.11.27 15:31
| 1 |