Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Lorraine Stephens   on Aug 18 In MS Office Category.

  
Question Answered By: Geena Ma.   on Aug 18


Here is an example of what I use. It's probably not the best way, but works
for me.

Dim wbName As String
Dim Wb1 As Workbook
Set Wb1 = ActiveWorkbook
Dim Wb2 As Workbook

wbName = Wb1.Sheets("Your Sheet").Range("Your Range")

Workbooks.Add
Set Wb2 = ActiveWorkbook

'Or

'Set Wb2 = Workbooks.Open("C:\Your XLS File.xls")

Wb1.Sheets("Your Sheet").Range("Your Range").Copy
Destination:=Wb2.Sheets("Your Sheet").Range("Your Range")
Application.DisplayAlerts = False
Wb1.Close False
ActiveWorkbook.SaveAs (wbName)
Application.DisplayAlerts = True

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Deleteing a file through VBA Or get search suggestion and latest updates.


Tagged: