How to create file as I type

Corpening, Jerry - HPW 1 Reputation point
2022-10-05T16:53:49+00:00

I want to create files using excel as I type in the file name.

Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,661 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Corpening, Jerry - HPW 1 Reputation point
    2022-10-06T12:55:28.043+00:00

    This is the code I am using. Sub MakeFolders()
    Dim Rng As Range
    Dim LastRow As Long
    Dim LastColumn As Long
    Dim maxRows As Integer
    Dim r As Integer
    Dim c As Integer

    Set sht = Worksheets("Sheet1")
    Set StartCell = Range("M:M")
    LastRow = sht.Cells(sht.Rows.Count, StartCell.Column).End(x1UIP).Row
    LastColumn = 1
    sht.Range(StartCell, sht, Cells(LastRow, LastColumn)).Select
    Set Rng = Selection
    maxRows = Rng.Rows.Count
    For c = 1 To 1
    r = 1
    Do While r <= maxRows
    If Len(Dir(ActiveWorkbook.Path & "\" & Rng(r, c), vbDirectory)) = 0 Then
    MkDir (ActiveWorkbook.Path & "\" & Rng(r, c))
    On Error Resume Next
    End If
    r = r + 1
    Loop
    Next c
    End Su