How to split MASTER DATA Into multiple sheets using VBA Macro

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 75

  • @harshababu8321
    @harshababu8321 ปีที่แล้ว +1

    Excellent explanation. Made it vey simple for all leaners

  • @satishkhubchandani520
    @satishkhubchandani520 2 ปีที่แล้ว +2

    Thank you🙏 I was looking for this macro to save time and you have explained it very well..

  • @kotakiran
    @kotakiran 2 ปีที่แล้ว +1

    Hi Avit its not working at Auto Filter stage .ITs showing blank
    Sheet1.Range("A1:P1").AutoFilter Field:=1, Criteria1:=Sheet1.Range("V" & LoopCounter).Value

  • @shona_joey.08
    @shona_joey.08 2 ปีที่แล้ว +2

    This is brilliant.... Made my life very easy. Thanks a lot for the video.....

  • @storekeeperTips
    @storekeeperTips 2 ปีที่แล้ว +1

    Fantastic bhai

  • @vandanabapunentertainment4798
    @vandanabapunentertainment4798 3 ปีที่แล้ว

    Very good. Easy Explain.👍👍👍

  • @ravibhushan669
    @ravibhushan669 3 ปีที่แล้ว +1

    Sir apki all video achhi hai, maine channel ko subscribe kar diya hai.
    Main all video dekhunga.

  • @meditatereflect3354
    @meditatereflect3354 2 ปีที่แล้ว +1

    I've used the macro but it seems it's counting all the cells in excel. It generated all sheets needed but no data

    • @avitguru
      @avitguru  2 ปีที่แล้ว

      Can you share your code.

    • @meditatereflect3354
      @meditatereflect3354 2 ปีที่แล้ว +1

      @@avitguru It's working already. In your code I changed the auto filter to 1 instead of 2. Thank you. Anyway.. do you have tutorial on how to split directly to multiple files instead of multiple worksheet?

    • @avitguru
      @avitguru  2 ปีที่แล้ว

      @@meditatereflect3354 yes I have

    • @avitguru
      @avitguru  2 ปีที่แล้ว +1

      th-cam.com/video/KMW45AwK44c/w-d-xo.html

    • @meditatereflect3354
      @meditatereflect3354 2 ปีที่แล้ว

      @@avitguru Thank you!

  • @riazkhan2623
    @riazkhan2623 2 ปีที่แล้ว +1

    Sir agar hum mastersheet me city add kare to us city ke namke worksheet me data chal jayega kya

  • @MIS_PRODUCTION_AAA
    @MIS_PRODUCTION_AAA ปีที่แล้ว +1

    Thanks

  • @sheenagoyal280
    @sheenagoyal280 ปีที่แล้ว

    Sir why it is copying only 1st column in my code.

  • @Omshanthiom9
    @Omshanthiom9 2 ปีที่แล้ว +1

    Hi Avit, the video is very much useful. Thanks for that.. i have a question, in case If there are some cells are blank ... In that case will macro work ...?

    • @avitguru
      @avitguru  2 ปีที่แล้ว

      Yes, but we need to verify our output.

    • @Omshanthiom9
      @Omshanthiom9 2 ปีที่แล้ว

      @@avitguru thanks for the prompt response... My doubt is, while macro creating unique value and splitting data to respective sheet ... In few of the lines are blank then will it skip those blank cells and take entire row data...?

    • @avitguru
      @avitguru  2 ปีที่แล้ว +1

      @@Omshanthiom9 if entire row is blank then macro will skip those rows.

    • @Omshanthiom9
      @Omshanthiom9 2 ปีที่แล้ว +1

      @@avitguru not entire row, few cells here and there are blank...?

    • @avitguru
      @avitguru  2 ปีที่แล้ว

      @@Omshanthiom9 then it will not skip

  • @umairsiddiqui3204
    @umairsiddiqui3204 2 ปีที่แล้ว

    Sir, why do I have this error. "Name argument not found" "CRITERIAL":=Sheet1.Range("L" & Loopcounter).Value. can any answer quickly please. I will appreciate it. thanks

    • @avitguru
      @avitguru  2 ปีที่แล้ว

      Write Criteria1 instead of CRITERIAL

  • @vishwa3448
    @vishwa3448 3 ปีที่แล้ว +1

    Sir review tab me share workbook karne ne bad ye Error aa jata hai- "run time error '1004' Advancedfilter method of Range class failed" , sir please help

    • @avitguru
      @avitguru  3 ปีที่แล้ว

      Code share Kar sakte ho kya

  • @letthemknowuncle5399
    @letthemknowuncle5399 2 ปีที่แล้ว

    Video is very useful.. thanks for this.

  • @revanthr47
    @revanthr47 3 ปีที่แล้ว +1

    Hi Sir, Video is great and easy to understand. Thanks!
    I have serial number as column in my Master sheet. Is there any way to make the serial number start from 1 after splitting the Master data?

    • @avitguru
      @avitguru  3 ปีที่แล้ว

      Yes, I will give you code tomorrow

  • @besspallysaikiran7820
    @besspallysaikiran7820 11 หลายเดือนก่อน

    Thanks bruh worked for me

  • @vibhutikumar3
    @vibhutikumar3 9 หลายเดือนก่อน

    very good

  • @sanjanamhatre8926
    @sanjanamhatre8926 5 หลายเดือนก่อน

    It's very helpful. Can you help me to send mail on outlook data which is split in different worksheets

  • @nehasaini755
    @nehasaini755 3 ปีที่แล้ว +1

    I am getting runtime error 1004 in 11th line.

    • @nehasaini755
      @nehasaini755 3 ปีที่แล้ว

      Please help to solve this

    • @avitguru
      @avitguru  3 ปีที่แล้ว

      Please send code line where you get an error

    • @nehasaini755
      @nehasaini755 3 ปีที่แล้ว

      Sheets(sheets.count).Name = Sheet1.Range("P" & LoopCounter).Value

    • @nehasaini755
      @nehasaini755 3 ปีที่แล้ว +1

      I am getting error- you typed invalid name of sheet or chart.
      1. The name you type doesn't exceed 31 characters
      2. You did not leave the name blank.
      Before this part my code is working fine. I used column P for storing unique values.

    • @avitguru
      @avitguru  3 ปีที่แล้ว

      @@nehasaini755 we cannot rename sheet with more than 31 characters or variable may be blank.

  • @Rohitburi
    @Rohitburi 2 ปีที่แล้ว

    Hello Sir,
    Thank you for the Video
    Can we talk about Some Other types of data kindly share your content Deatils please

  • @manaswinisahoo4555
    @manaswinisahoo4555 4 ปีที่แล้ว

    Thanks for the great vdo❤️

  • @pool54
    @pool54 3 ปีที่แล้ว +1

    Can u paste coding here

    • @avitguru
      @avitguru  3 ปีที่แล้ว

      you can give me your email id. i will send to you file.

    • @pool54
      @pool54 3 ปีที่แล้ว

      @@avitguru in this every time he add sheets i want if sheet there (check sheet name ) only paste data
      mail me patidarrohit@gmail.com

  • @a2zofloans521
    @a2zofloans521 3 ปีที่แล้ว

    Thanks bro it helped me a lot

  • @Bharat_mata_ki_jai_1
    @Bharat_mata_ki_jai_1 ปีที่แล้ว

    nice

  • @hemantsingh2825
    @hemantsingh2825 2 ปีที่แล้ว +1

    Can u please share the code

    • @avitguru
      @avitguru  2 ปีที่แล้ว

      Give me your email I will share the fill

  • @manaswinisahoo4555
    @manaswinisahoo4555 4 ปีที่แล้ว +1

    Mujhe ak error araha hai :named argument not found 🙄

    • @avitguru
      @avitguru  4 ปีที่แล้ว

      plz send me syntax

    • @manaswinisahoo4555
      @manaswinisahoo4555 4 ปีที่แล้ว +1

      @@avitguru thanks for your reply .
      I fixed that issue and now its working fine ..😁

    • @avitguru
      @avitguru  4 ปีที่แล้ว

      @@manaswinisahoo4555 👍

  • @joaocruz2082
    @joaocruz2082 3 ปีที่แล้ว

    Dear Sir , thank you, could you please give me a simple solution to split a file per number of lines, for example 200 ,300 500 lines.

    • @avitguru
      @avitguru  3 ปีที่แล้ว +1

      Okay, I will make video for this

    • @jayakrishnank4236
      @jayakrishnank4236 ปีที่แล้ว

      @@avitguru sir im waiting for this video

  • @bhimsharma3934
    @bhimsharma3934 ปีที่แล้ว

    Plz share code

  • @trushikpanchal
    @trushikpanchal ปีที่แล้ว

    Wonderful video! Can you please share the code via email?

  • @jeromeimmanuvel3324
    @jeromeimmanuvel3324 3 ปีที่แล้ว +2

    If it is hindi video. Mention it is Hindi in the title. I have given dislike ...

    • @avitguru
      @avitguru  3 ปีที่แล้ว

      Many youtuber mentioned english title of the Hindi video.

  • @jayeshs6618
    @jayeshs6618 3 ปีที่แล้ว

    Hello,
    1. Ye line me Filed:=5 (Is it Row number or Column number)?
    Sheets("Data").Range("A1:J1").AutoFilter Field:=5, Criteria1:=Sheets("Data").Range("R" & LoopCounter).Value
    2. And Sheets create hua hai but data copy paste nahi ho raha hai except headers. Below is the coding. Please help.
    Sub Split()
    Workbooks("ZADJUST.xlsm").Sheets("Data").Activate
    Dim iRow As Integer
    Dim Rng As Range
    Dim LoopCounter As Integer
    iRow = Sheets("Data").Cells(Rows.Count, "I").End(xlUp).Row
    Set Rng = Sheets("Data").Range("I1:I" & iRow)
    Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheets("Data").Range("R1"), Unique:=True
    For LoopCounter = 2 To Sheets("Data").Cells(Rows.Count, "R").End(xlUp).Row
    Sheets("Data").Range("A1:J1").AutoFilter Field:=5, Criteria1:=Sheets("Data").Range("R" & LoopCounter).Value
    Sheets.Add After:=Sheets(Sheets.Count)
    Sheets(Sheets.Count).Name = Sheets("Data").Range("R" & LoopCounter).Value
    Sheets("Data").Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy
    Sheets(Sheets.Count).Range("A1").PasteSpecial xlPasteAll
    Application.CutCopyMode = False
    Next LoopCounter
    Sheets("Data").AutoFilterMode = False
    End Sub

    • @avitguru
      @avitguru  3 ปีที่แล้ว +1

      Field=5 is a header position of data, means it is a column

    • @jayeshs6618
      @jayeshs6618 3 ปีที่แล้ว +1

      Thanks and mera data copy paste nahi ho raha hai except header.... please refer the coding

    • @avitguru
      @avitguru  3 ปีที่แล้ว

      @@jayeshs6618 can you call me.
      My mobile number is in my website.

  • @rahulkamble4737
    @rahulkamble4737 3 ปีที่แล้ว +1

    Sub fileopen()
    Dim My_file As String
    Dim iRow As Integer
    Dim Rng As Range
    Dim LoopCounter As Integer
    iRow = Sheet1.Cells(Rows.Count, "B").End(xlUp).Row
    My_file = Application.GetOpenFilename()
    Worksheets("Sheet1").Range("J3").Value = My_file
    Workbooks.Open My_file
    Set Rng = Sheet1.Range("B1:B" & iRow)
    'here I am getting run time error from Rng.advanced.
    Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheet1.Range("BA1"), Unique:=True
    For LoopCounter = 2 To Sheet1.Cells(Rows.Count, "BA").End(xlUp).Row
    Sheet1.Range("A1:AQ1").AutoFilter Field:=2, Criteria1:=Sheet1.Range("BA" & LoopCounter).Value
    Sheets.Add After:=Sheets(Sheets.Count)
    Sheets(Sheets.Count).Name = Sheet1.Range("BA" & LoopCounter).Value
    Sheet1.Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy
    Sheets(Sheets.Count).Range("A1").PasteSpecial xlPasteAll
    Application.CutCopyMode = False
    Next LoopCounter
    Sheet1.AutoFilterMode = False
    'Select all sheets
    Dim myArray() As Variant
    Dim i As Integer
    For i = 1 To Sheets.Count
    ReDim Preserve myArray(i - 1)
    myArray(i - 1) = i
    Next i
    Sheets(myArray).Select
    Cells.Select
    Cells.EntireColumn.AutoFit
    Columns("B").EntireColumn.Delete
    Columns("AZ").EntireColumn.Delete
    Sheet1.Delete
    Application.DisplayAlerts = True
    MsgBox ("All Sheets has been created")
    End Sub

    • @avitguru
      @avitguru  3 ปีที่แล้ว

      th-cam.com/video/NF3hW5M_0yo/w-d-xo.html
      Isme use Kiya hai maine

    • @rahulkamble4737
      @rahulkamble4737 3 ปีที่แล้ว

      @@avitguru Hello sir I don't want file path.. see I M getting error in below code..
      Sub fileopen()
      Dim My_file As String
      Dim iRow As Integer
      Dim Rng As Range
      Dim LoopCounter As Integer
      iRow = Sheet1.Cells(Rows.Count, "B").End(xlUp).Row
      My_file = Application.GetOpenFilename()
      Workbooks.Open My_file
      Set Rng = Sheet1.Range("B1:B" & iRow)
      *****'Geting error from below code.*******
      Just want to open excel file and run your macro..
      Actual code should be in different Excel workbook.
      Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheet1.Range("BA1"), Unique:=True
      For LoopCounter = 2 To Sheet1.Cells(Rows.Count, "BA").End(xlUp).Row
      Sheet1.Range("A1:AQ1").AutoFilter Field:=2, Criteria1:=Sheet1.Range("BA" & LoopCounter).Value
      Sheets.Add After:=Sheets(Sheets.Count)
      Sheets(Sheets.Count).Name = Sheet1.Range("BA" & LoopCounter).Value
      Sheet1.Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy
      Sheets(Sheets.Count).Range("A1").PasteSpecial xlPasteAll
      Application.CutCopyMode = False
      Next LoopCounter
      Sheet1.AutoFilterMode = False
      'Select all sheets
      Dim myArray() As Variant
      Dim i As Integer
      For i = 1 To Sheets.Count
      ReDim Preserve myArray(i - 1)
      myArray(i - 1) = i
      Next i
      Sheets(myArray).Select
      Cells.Select
      Cells.EntireColumn.AutoFit
      Columns("B").EntireColumn.Delete
      Columns("AZ").EntireColumn.Delete
      Sheet1.Delete
      Application.DisplayAlerts = True
      MsgBox ("All Sheets has been created")
      End Sub