VBA - Copy And Paste (Values) for Multiple Worksheets

rodrigo_m_almeida

New Member
Joined
Jan 13, 2022
Messages
42
Office Version
  1. 2021
Platform
  1. Windows
I need help to copy and paste only the values of a sheet from other workbooks.

This is the code I'm using

VBA Code:
Public Sub TEST()

    Application.ScreenUpdating = False
    
    Set Wb = Workbooks.Open("C:\ETC\01_12_2021.xlsm", UpdateLinks:=False) 
    Wb.Sheets("Resumo_1").Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
    ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
    Wb.Close savechanges:=False
    ActiveSheet.Name = "01" ' - Day 01
    
    Set Wb = Workbooks.Open("C:\ETC\02_12_2021.xlsm", UpdateLinks:=False) 
    Wb.Sheets("Resumo_1").Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
    ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
    Wb.Close savechanges:=False
    ActiveSheet.Name = "02" ' - Day 02
    
    Application.ScreenUpdating = True
        
End Sub

I needed to open all the files in my folder copy and paste only the sheet values (Resumo_1) from other worksheets to my and rename to 01,02,03,31,etc...
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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