Code Help - Automation

Joneye

Well-known Member
Joined
May 28, 2010
Messages
785
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
I have a work book with many tabs, I wish just for one tab to be exported with the data to a Named folder.

Also this process will take place a few times a week so if the above is possible the exported work book must not conflict with the last.

Is this possible?
 
many thanks,

I have a minor hitch, Possible me - "Debug" and the error points to the below.

I have put this all in one module is that correct?


Sub SaveSheet()
Dim ws As Worksheet
Sheets(Array("1.1 houses", "4. commercial")).Copy
For Each ws In ActiveWorkbook With ws.UsedRange
.Value = .Value
End With
Next ws
With ActiveWorkbook
.SaveAs Filename:="C:\Documents and Settings\REMOVED\Desktop\TEST\Copy " & Format(Now, "ddmmyyyy hhmmss") & ".xls"
.Close
End With
End Sub
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Oops!

Rich (BB code):
Sub SaveSheet()
Dim ws As Worksheet
Sheets(Array("Sheet1", "Sheet2")).Copy
For Each ws In ActiveWorkbook.Worksheets
    With ws.UsedRange
        .Value = .Value
    End With
Next ws
With ActiveWorkbook
    .SaveAs Filename:="C:\test\Copy " & Format(Now, "ddmmyyyy hhmmss") & ".xls"
    .Close
End With
End Sub
 
Upvote 0
JUST AMAZING - thank you.

VOG were can I learn a simple start in to actions within VBA like an IDTIOTS guide
 
Upvote 0
VOG - again brilliant.

Many thanks for all your help today.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,711
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top