Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 24 of 24

Thread: Macro to split data based on the value from specific column

  1. #21
    there was no table, so i add one.
    because on your original post there is a table.

    there is a code in ThisWorkbook, Open event, copy that to your workbook.
    there is a code in Module1 copy the whole module to your workbook.
    create "job" sheet to your workbook.
    and add a button and assigned a sub to it.
    Attached Files Attached Files

  2. #22
    I ran the macro on the file you send over. I got debug after created 601 folder on below line. There is no file into 601 folder though.
    Below part
    'arnelgp
    'from macro
    Private Sub FilterTable(ByVal strValue As String)
        myWorkbook.Activate
        myListObject.Range.AutoFilter Field:=7, Criteria1:=strValue
    End Sub
    Debug on below line
    myWorkbook.Activate

  3. #23
    i also got error when opening the workbook.

    try to update the code in ThisWorkbook:

    Private Sub Workbook_Open()
    Set Module1.myWorkbook = ThisWorkbook
    Set Module1.myListObject = ThisWorkbook.Sheets("Data").ListObjects(1)
    End Sub

    then close and re-open the workbook.
    Last edited by Aussiebear; 08-01-2022 at 01:14 AM. Reason: Added code tags to supplied code

  4. #24
    Thank you it works, I really appreciate your help.

Posting Permissions

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