返回列表 上一主題 發帖

sheet 存檔案 檔案抓sheet 的問題

回復 1# CYC
  1. Sub Button1()
  2. Dim fs As String
  3. fs = Application.GetOpenFilename
  4. With Workbooks.Open(fs)
  5. .Sheets("test1").Copy after:=ThisWorkbook.Sheets(Sheets.Count)
  6. .Close
  7. End With
  8. End Sub
  9. Sub Button2()
  10. Dim fs As String
  11. With Application.FileDialog(msoFileDialogSaveAs)
  12. .Show
  13. If .SelectedItems.Count = 1 Then fs = .SelectedItems(1) Else MsgBox "請輸入存檔檔名": Exit Sub
  14. Sheets("test2").Copy
  15. ActiveWorkbook.SaveAs fs
  16. End With
  17. End Sub
  18. Sub Button3()
  19. Sheets("Sheet3").[A1:C1] = Array("name", "student", "sex")
  20. End Sub
複製代碼
學海無涯_不恥下問

TOP

        靜思自在 : 好事要提得起,是非要放得下,成就別人即是成就自己。
返回列表 上一主題