KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 453
- Office Version
- 2016
- Platform
- Windows
Hello everyone
I use this VBA code to import data from multiple files, it works really well.
But in column K in the source file there are some formulas with values, now I would like the data without formulas returned.
Anyone who can help?
Any help will be appreciated.
Best Regards
Klaus W
I use this VBA code to import data from multiple files, it works really well.
But in column K in the source file there are some formulas with values, now I would like the data without formulas returned.
Anyone who can help?
Any help will be appreciated.
Best Regards
Klaus W
VBA Code:
Sub Master_Rektangelafrundedehjørner2_Klik()
Dim stgF As String, stgP As String
Dim wb As Workbook
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Master") 'Assuming that "Master" is the destination sheet name.
stgP = "D:\DNBR 2024\Hoffet\Hoffet overigt over middage og receptioner\" '---->Insert your file path.
stgF = Dir(stgP & "\*.xls*")
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
Do While stgF <> vbNullString
Set wb = Workbooks.Open(stgP & "\" & stgF)
With wb.Sheets(1)
.UsedRange.Offset(2).Copy ws.Range("A" & Rows.Count).End(3)(2)
ws.Columns.AutoFit
End With
wb.Close Save = False
stgF = Dir()
Loop
Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Application.DisplayCommentIndicator = xlNoIndicator
Worksheets("Master").Cells.EntireRow.AutoFit
End Sub