Yes. In Excel for Microsoft 365 on Windows, you can import each CSV manually with Data > Get Data > From File > From Text/CSV and load it to a worksheet, or use a short VBA macro to put every CSV in a folder on its own sheet. For a recurring folder of files, the macro is faster; Power Query is usually better when you want to combine and refresh the files as one table.
What “multiple CSVs as sheets” means
A CSV file stores tabular data as plain text, usually with commas between fields. It does not store Excel worksheets, formatting, formulas as Excel objects, or multiple tabs. When you import a CSV into an Excel workbook, Excel parses that text and places the result in a worksheet. The task is to repeat that import for each file while keeping all the resulting worksheets in one workbook.
This is different from combining CSV files. If you have sales_2026-01.csv, sales_2026-02.csv, and sales_2026-03.csv, separate sheets leave each month in its own tab. A combined import appends the three sets of rows into one table, which is often easier to filter, summarize, and chart. Decide which layout you need before importing: a sheet per file is convenient for reviewing files individually, while a single table is generally more useful for analysis across all files.
Import one CSV to a new worksheet
For a small number of files, use Excel’s import interface once per CSV. This gives you a chance to inspect the preview and set import options rather than relying on Excel to guess how every value should be interpreted.
- Open the destination workbook and select Data > Get Data > From File > From Text/CSV.
- Choose a CSV file and select Import. Check the preview, especially the delimiter, column headings, and values with leading zeros or dates.
- Select Load to place the data in a worksheet. If you need to choose where it goes, use the Load menu’s Load To option and select a new worksheet.
- Repeat for each remaining file, choosing a new worksheet each time.
Excel may show a preview and offer settings such as the file origin, delimiter, and data type detection. Use these controls when the default interpretation is wrong. For example, a code such as 00418 may be converted to the number 418 if Excel treats the column as numeric. Importing that column as text preserves the zeros.
When you load into a new worksheet, Excel may create a query connection as well as the visible data, depending on the import route and load settings. That can be useful if you want to refresh the import later. A one-time paste or open-and-copy approach is quicker for a single file, but it gives you less control over parsing and repeatability.
Import a whole folder to separate sheets with VBA
Excel’s built-in From Folder connector is designed chiefly to combine files with a consistent structure; its normal combine workflow does not automatically create one worksheet per CSV. If you need a separate tab for every file, a VBA macro can automate opening each CSV and copying its worksheet into the destination workbook. The example below processes CSV files in the selected folder, not in its subfolders. It names each new sheet after its file and adds a suffix if names collide.
Save the destination workbook as an Excel Macro-Enabled Workbook (.xlsm). Press Alt+F11 on Windows to open the Visual Basic Editor, choose Insert > Module, and paste the complete code into that module. Run ImportCsvFilesAsSheets from the editor or from Excel’s Developer > Macros command.
Option Explicit
Sub ImportCsvFilesAsSheets()
Dim targetWb As Workbook
Dim sourceWb As Workbook
Dim folderPicker As FileDialog
Dim folderPath As String
Dim fileName As String
Dim filePath As String
Dim newName As String
Dim oldScreenUpdating As Boolean
Dim failureMessage As String
Set targetWb = ThisWorkbook
Set folderPicker = Application.FileDialog(msoFileDialogFolderPicker)
With folderPicker
.Title = "Select the folder containing CSV files"
.AllowMultiSelect = False
If .Show <> -1 Then Exit Sub
folderPath = .SelectedItems(1)
End With
oldScreenUpdating = Application.ScreenUpdating
On Error GoTo CleanFail
Application.ScreenUpdating = False
fileName = Dir(folderPath & Application.PathSeparator & "*.csv")
Do While Len(fileName) > 0
filePath = folderPath & Application.PathSeparator & fileName
Set sourceWb = Workbooks.Open(Filename:=filePath, Local:=True)
sourceWb.Worksheets(1).Copy After:=targetWb.Sheets(targetWb.Sheets.Count)
newName = UniqueSheetName(targetWb, BaseSheetName(fileName))
targetWb.Worksheets(targetWb.Worksheets.Count).Name = newName
sourceWb.Close SaveChanges:=False
Set sourceWb = Nothing
fileName = Dir()
Loop
CleanExit:
Application.ScreenUpdating = oldScreenUpdating
MsgBox "CSV import finished.", vbInformation
Exit Sub
CleanFail:
failureMessage = Err.Description
On Error Resume Next
If Not sourceWb Is Nothing Then sourceWb.Close SaveChanges:=False
Application.ScreenUpdating = oldScreenUpdating
On Error GoTo 0
MsgBox "Import stopped: " & failureMessage, vbExclamation
End Sub
Private Function BaseSheetName(ByVal fileName As String) As String
Dim dotPosition As Long
Dim result As String
Dim invalidChars As Variant
Dim item As Variant
dotPosition = InStrRev(fileName, ".")
If dotPosition > 0 Then
result = Left$(fileName, dotPosition - 1)
Else
result = fileName
End If
invalidChars = Array(":", "\", "/", "?", "*", "[", "]")
For Each item In invalidChars
result = Replace(result, CStr(item), "_")
Next item
result = Trim$(result)
Do While Len(result) > 0 And Left$(result, 1) = "'"
result = Mid$(result, 2)
Loop
Do While Len(result) > 0 And Right$(result, 1) = "'"
result = Left$(result, Len(result) - 1)
Loop
If Len(result) = 0 Then result = "CSV"
BaseSheetName = Left$(result, 31)
End Function
Private Function UniqueSheetName(ByVal wb As Workbook, ByVal baseName As String) As String
Dim candidate As String
Dim suffix As String
Dim n As Long
candidate = Left$(baseName, 31)
n = 1
Do While SheetExists(wb, candidate)
suffix = "_" & CStr(n)
candidate = Left$(baseName, 31 - Len(suffix)) & suffix
n = n + 1
Loop
UniqueSheetName = candidate
End Function
Private Function SheetExists(ByVal wb As Workbook, ByVal sheetName As String) As Boolean
Dim ws As Worksheet
On Error Resume Next
Set ws = wb.Worksheets(sheetName)
On Error GoTo 0
SheetExists = Not ws Is Nothing
End Function
Before running any macro, save a separate copy of the workbook: macros cannot be undone with Ctrl+Z. The macro opens files using Excel’s normal CSV handling, so it may interpret dates, numbers, delimiters, and character encoding according to Excel and the system’s regional settings. Test it first on copies of a few representative files, particularly if the data includes identifiers, international characters, or unusual delimiters.
Prepare the files and workbook
Make sure the files are genuinely CSV files and that the destination workbook is not itself inside the folder you plan to process. Keep the source files together in one folder if using the macro. It imports only files in that folder’s top level, and it creates sheets in the workbook containing the macro. Running it again will import the same files again; duplicate sheet names receive suffixes such as _1 and _2 rather than replacing earlier sheets.
Check whether the CSVs share the same column structure. Separate tabs can hold different layouts, but consistent headings and column order make the workbook much easier to compare. Also check that each file has a header row if you expect field names to appear as the first row. CSV files do not define a formal schema, so a first row containing labels is just text unless Excel or a later query treats it as headers.
Keep a copy of the original CSVs. Once data is loaded into Excel and saved as an .xlsx or .xlsm workbook, values may have been converted or interpreted. The original text files are a reference if you need to verify whether an identifier lost leading zeros or a date was read differently from its intended format.
When Power Query is a better fit
Use Power Query when you expect to repeat the import, need consistent cleanup, or ultimately want one combined dataset. In Excel for Microsoft 365 on Windows, choose Data > Get Data > From File > From Folder, select the folder, and review the listed files. The Combine option is designed to apply a transformation to files with a compatible structure and append their rows. Load the resulting query when you are satisfied, then use Refresh to update it after adding or changing files.
Power Query is also useful for keeping fields as text, removing unwanted columns, promoting headers, filtering rows, or standardizing dates before loading. Its folder workflow is not the same as “one file, one worksheet”: combining normally produces one result table. If separate sheets are essential, import files individually through Text/CSV, or use VBA for a repeatable batch. You can also build and manage separate queries, but that is more setup than the macro for a simple folder import.
On Excel for Mac and Excel for the web, available connectors and menu layouts can vary by release and account. If the From Folder connector or a particular load option is absent, use the available Text/CSV import for individual files or work in Excel for Windows. The VBA editor is available in desktop Excel for Mac, but shortcut keys and file-picker behavior can differ; use the application’s Tools or Developer menus if the Windows shortcut does not open it.
Common problems and how to avoid them
- Leading zeros disappear: Excel may convert a value such as 00057 to 57. Import the column as text in the preview or transform it as text in Power Query.
- Dates change unexpectedly: Values such as 03/04/2026 are ambiguous across regional date conventions. Check the preview and set the intended data type and locale where the import interface permits it.
- Characters look corrupted: The file may use a different encoding than Excel assumes. Re-import through Text/CSV and choose an appropriate file origin if available; verify accented and non-Latin text before distributing the workbook.
- Everything appears in one column: The delimiter may be a semicolon, tab, or another character rather than a comma. Select the correct delimiter in the import preview.
- A sheet name is rejected: Excel sheet names cannot exceed 31 characters or contain certain characters. The macro replaces common invalid characters, truncates long names, and adds a suffix for duplicates.
- The macro stops partway through: One file may be locked, malformed, or formatted differently. The macro reports an error and stops; inspect the last imported sheet and test the remaining files separately.
CSV files can also contain text beginning with characters Excel interprets as formulas. Do not treat files from an unknown or untrusted source as harmless just because they are plain text. Review unexpected formula-like values and use your organization’s macro and file-security policies. Enabling macros should be limited to workbooks and code you trust.
Which method should you choose?
Choose the simplest approach that matches the job. For two or three files that need a quick one-time import, use Text/CSV and load each into a new worksheet. For dozens of files that must remain separate, use the macro after testing it on copies. For recurring reports where the files have the same columns and you want to analyze all rows together, use Power Query’s From Folder workflow. If file layouts differ substantially, inspect and import them individually rather than assuming a combine operation can reconcile them automatically.
Remember that a workbook has a limit of 1,048,576 rows per worksheet. A separate-sheet workflow does not remove that limit for any individual CSV, and a very large number of sheets can make a workbook awkward to navigate or slow to work with. If the files are large or intended for analysis as a dataset, combining and filtering in Power Query—or using a database or other data tool—may be more practical than maintaining many tabs.
Frequently Asked Questions
Can Excel import multiple CSV files into separate sheets automatically?
Not through the standard From Folder combine workflow, which is intended to combine compatible files into one result. For separate sheets, import each file individually or use a VBA macro such as the example above.
Does Data > From Folder create one tab for every CSV?
No. Its usual Combine workflow appends data from compatible files into a combined query result. Use it when one table is the goal, not when each source file must have its own worksheet.
Will the imported sheets update if I change a CSV?
A simple copy made by the macro does not refresh from the source; it is a snapshot. A Power Query import can be refreshed, but a folder-combine query normally refreshes a combined result rather than maintaining one tab per file.
Can I import CSVs from different folders?
The example macro asks for one folder and processes its top-level .csv files only. Move the files into one folder first, or adapt the code if you need recursive folder scanning or a different file-selection rule.
Can I use this method in Excel for Mac?
Manual Text/CSV imports are available in desktop Excel for Mac, although menu paths and options can differ. VBA is also supported in desktop Excel for Mac, but test the macro with copies because platform-specific file-picker and path behavior may vary.
Should I import each CSV as a sheet or combine them?
Use separate sheets when you need to inspect or deliver each file independently. Combine them when the files represent the same kind of records and you want to sort, filter, summarize, or compare all records in one table.
Related
- Excel Hide Columns Based on Date: Methods That Work
- Excel Hide Columns From Certain Users: What Actually Works
- Excel Hide Column Letters? What the Setting Actually Does
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Make Columns in Word on Half a PageTo make columns in only part of a page in Microsoft Word, isolate that content between two continuous…
- SUMIF Negative Values in Google Sheets: A Clear GuideTo add negative numbers in Google Sheets, use SUMIF with the criterion "<0". If the values are in…
- Excel Decrease Decimal Shortcut: Steps, Mac, and FixesIn Excel for Microsoft 365 on Windows, select the cell or cells and press Alt, H, 9 to…
- How to Use Styles Properly in Microsoft WordUse styles in Microsoft Word by applying built-in styles such as Normal and Heading 1 from Home >…
- Turn Off Flash Fill in Excel (and Keep Manual Fill)Yes. In Excel for Microsoft 365 on Windows, go to File > Options > Advanced, clear Automatically Flash…
- How to Insert a Row in Excel on a Laptop, Step by StepTo insert a blank row in Excel on a laptop, select the row number where you want the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.