Hi Team,

I am trying to do below in an excel. You can assume there are 60 worksheets 
minimum in a workbook.

1. In opened excel file. Which has links from several files
2. All cells of the workbook I am doing paste special values
3. Then to come at the first cell in all worksheets (i.e. Cell A1)
4. Then to come at first tab, first cell, Save the workbook here (so 
whenever excel opens the person will see first sheet, first cell)
5. Close the workbook

I am having below vba code. It is taking forever to run (minimum 15-20 
minutes). Can anyone please help in boosting speed so could be run in 
fraction of seconds.


Sub Select_All_Sheets()
Dim sht As Worksheet
Dim SelectMe() As String
Dim s As Integer
For Each sht In Worksheets
s = s + 1
ReDim Preserve SelectMe(1 To s) As String
SelectMe(s) = sht.Name
Sheets(SelectMe).Select
Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, 
SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
    Application.Goto Range(Cells(ActiveWindow.SplitRow + 1, 
ActiveWindow.SplitColumn + 1).Address)
    ActiveWorkbook.Save
Next
End Sub

Regards,
Kaushik Savla

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at https://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to