+ Reply to Thread
Results 1 to 5 of 5

File Split Macro Adjustment Needed

  1. #1
    Registered User
    Join Date
    04-01-2011
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 365
    Posts
    31

    File Split Macro Adjustment Needed

    Hello,
    VBA novice here. Found this code and adjusted it to fit my needs but it's not quite hitting the mark. Needs a slight tweak.
    Macro is supposed to split master file in to separate ones at every change in Supervisor name. Header row is being copied to new file, but no other data. Can't figure out why.
    Sample workbook attached. Thank you in advance for any and all help.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: File Split Macro Adjustment Needed

    please release the file so that it can be opened
    Screenshot 2022-09-18 165548.png
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    04-01-2011
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 365
    Posts
    31

    Re: File Split Macro Adjustment Needed

    Reattaching new version of workbook here.
    Attached Files Attached Files

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: File Split Macro Adjustment Needed

    I altered the save line to the code below and it saved four individual workbooks to my desktop suitable named.
    is it the fact you call '\Desktop\Desktop' a double call.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hello, try this ...


    According to the attachment an Excel basics VBA demonstration as a beginner starter :

    PHP Code: 
    Sub Demo1()
        
    With Application
           
    .DisplayAlerts False
           
    .ScreenUpdating False
        With 
    [A1].CurrentRegion.Columns
           
    .Item(1).AdvancedFilter 2, , .Cells(1, .Count 3), True
            Workbooks
    .Add xlWBATWorksheet
        
    For Each V In Range(.Cells(2, .Count 3), .Cells(1, .Count 3).End(xlDown)).Value
           
    .Cells(2, .Count 3) = V
           
    .AdvancedFilter 2, .Cells(1, .Count 3).Resize(2), [A1].CurrentRegion.Rows(1)
            
    ActiveWorkbook.SaveAs ThisWorkbook.Path "\" & V, 51
        Next
           .Cells(1, .Count + 3).CurrentRegion.Clear
        End With
            ActiveWorkbook.Close
           .DisplayAlerts = True
           .ScreenUpdating = True
        End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon ? Add Reputation ? !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. File Split Macro Adjustment Needed
    By fgbdrum in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2022, 02:43 PM
  2. Macro adjustment needed: merged cells & countif match
    By djvent in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2014, 04:03 PM
  3. Macro Adjustment Needed To Stop Deleting Row When Cancelled
    By JimmiOO in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-24-2010, 02:41 AM
  4. macro adjustment needed causing freeze
    By ryanb4614 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-29-2010, 09:46 PM
  5. Macro Adjustment Needed To Stop Freeze
    By JimmiOO in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-09-2010, 01:48 PM
  6. Macro Adjustment Needed
    By JimmiOO in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-15-2010, 07:55 AM
  7. [SOLVED] Event Macro adjustment needed - need to change font color also
    By nick s in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-28-2005, 01:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1