Results 1 to 8 of 8

Thread: Make macro create unique files only once.If files exist amend them.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Mar 2018
    Posts
    12
    Rep Power
    0
    Hi Al,

    I am a novice at 57 years of age with coding. At my work (still working) we were told we could not use MS Access anymore, so I have to learn MS Excel. With MS Access, I did not have to do much coding. With MS Excel coding I am at sea!

    Basically, we have a few people in our team. We gave a file called xMaster.xlsm where the team leader enters our duties and clicks a button and the work is split. The files are formed at the same location. I found the code at the following place and modified it slightly so that the date stamp is not attached to the unique file created.

    The site is https://stackoverflow.com/questions/...-a-column?rq=1
    The code is as below

    [code]
    Sub ExportByName()
    Dim unique(1000) As String
    Dim wb(1000) As Workbook
    Dim ws As Worksheet
    Dim x As Long
    Dim y As Long
    Dim ct As Long
    Dim uCol As Long
    On Error GoTo ErrHandler
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    'Your main worksheet
    Set ws = ActiveWorkbook.Sheets("Sheet1")
    uCol = 7 'Column G
    ct = 0
    For x = 2 To ws.Cells(ws.Rows.Count, uCol).End(xlUp).Row 'get a unique list of users
    If CountIfArray(ActiveSheet.Cells(x, uCol), unique()) = 0 Then
    unique(ct) = ActiveSheet.Cells(x, uCol).Text
    ct = ct + 1
    End If
    Next x
    For x = 0 To ws.Cells(ws.Rows.Count, uCol).End(xlUp).Row
    Attached Files Attached Files

Similar Threads

  1. Macro To Close All CSV Files
    By Howardc in forum Excel Help
    Replies: 5
    Last Post: 03-15-2014, 05:24 PM
  2. Macro to fetch csv files
    By dhivya.enjoy in forum Excel Help
    Replies: 2
    Last Post: 10-21-2013, 05:44 PM
  3. Replies: 15
    Last Post: 08-23-2013, 12:03 PM
  4. Replies: 2
    Last Post: 04-14-2013, 09:15 PM
  5. Macro to create files as per the contents in a column
    By Praveen Bj in forum Excel Help
    Replies: 1
    Last Post: 07-05-2012, 09:07 PM

Posting Permissions

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