How to Split MASTER DATA Into Separate Workbooks Using VBA Macro

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2024
  • How to Split MASTER DATA Into Separate Workbooks Using VBA Macro?

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

  • @AshutoshKumar-kg9cp
    @AshutoshKumar-kg9cp 2 ปีที่แล้ว +1

    Thanku so much Avit sir you helped me a lot and you are very nice person god bless you sir.

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

    I didn't understand what you were saying, but this whole video was very understandable by the way you were moving your mouse around and showing the results side by side. Or maybe I spoke Hindi (language?) in a past life? Great job, I am checking out your other videos!

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

    Excellent teaching, you saved my day...

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

    Great brother....you explained in too simple way

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

    This can't be applied to the selected range error aa rha hai
    Advancedfilter copy to range wale m
    Please solve it.

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

      Can you share your code?

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

      @@avitguru this code not run.
      Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("M1"), Unique:= True

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

    Very excellent vedio. But it woks only for Number of rows data less then 1000, whatif its more data 300000 lines . What changes need to make in macro code

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

    Hi , Thank you so much for providing complete step by step details...Can you please share the scripted code...

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

    Great! Thanks sharing such an excellent video. I have some predefined invoice templates in which each supplier is different. How do I copy the data and paste those different templates? I will remain grateful to you.

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

      It is doable, Can you call me, my number is my website.

  • @MohAboAbdo
    @MohAboAbdo 6 หลายเดือนก่อน

    Thank you so much

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

    Thank you.u r explained step by step but I have spliced the data based on distrct code its splitting only column header for all districts data not coming

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

    Hi sir humne data split kra according to city but jb city wise split krke new workbook city name h to city column kyu sana chahiye split hokr sirf 4 column hi aana chahiye

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

    Hi Avit,
    I actuality dont know about excel but in my work excel is been used where data is pull from an application into excel report, where in that report there is huge data and data starts from 5 row, where in first four rows contains formulas and and some data about report which is of no use, so i just wanted to know that this coding will help when i select the data from 5 row and it gets worked. Thank you in advance!

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

    Thanks for sharing such a great content. I am using two sheets, first sheet has some summary based on 2nd sheet. 2nd sheet has the main data. I am able to split the workbook but I don’t see the 1st sheet in the splitted workbook. Kindly advise !

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

    Thanks☺️ - good explained step by step
    Kindly explain us more project in hindi language

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

    Good 👍

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

    Hi sir, I am getting an error while execution "Run time error '91' object variable or with block variable not set
    How to remove this error

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

      On which line?

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

    Hi Avit, I have query. how can I connect with you?

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

      Avitwebtraining@gmail.com

  • @user-ix9hb7je4lGaurav
    @user-ix9hb7je4lGaurav 5 หลายเดือนก่อน

    I have questions
    Are you students of Future in hand Vaishali NCR

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

    Sirji specific location ka liye kya karna hoga,
    Like if i want to save file into specific location.which is ask to as when we download file from online.
    Can you please so tht

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

    Hello, i used the same code, but the sheets that get created have only the header. How do i solve that problem

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

      May be data is not visible while filtering. Please check field position in the data.

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

    Hi Sir, how can I use different names of sheet1(Amit Kumar) which is in column (d), and save it as file name (Amit Kumar Aug'2022 Report.xlsx) in column(E). so where I can change in VBA code. pls help

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

    Hello Sir can you add pivot table also in multiple workbook using vb

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

    Thanks for such a learning content. Can you share the code please

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

      Can you contact me.

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

    Hello Sir,
    I am able run the code getting files with new name but under new excel file only headers are present, data is missing.
    Could you please help me

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

      Yes I can. Please call me tomorrow.

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

    This macro coding will run for how many rows?

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

      Macro can run for 1048576 rows. But in that case we need to change data type for numerical values

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

    Again thanks for the video ❤️

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

    Good video - Thanks👍
    Pls share more coding video explain in hindi language

  • @nitesh.2019
    @nitesh.2019 3 ปีที่แล้ว +1

    agar 2 ya usse jyada sheets hai states ke related data wale in 1 workbook and split karne ke baad resulting file mein bhi us state ke multiple sheets 1 file mein chahiye toh kaise possible hoga?
    For e.g yaha pe aapke 2 master sheet hote Master 1 & Master 2 aur aapko resulting file mein Mumbai wale file mein Mumbai related Master 1 & Master 2 chahiye.

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

      Ok

    • @nitesh.2019
      @nitesh.2019 3 ปีที่แล้ว +1

      @@avitguru kaise possible hoga uska coding bata sakte hai kya aap please

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

      @@nitesh.2019 can you contact me? Mobile numbers is on my website.

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

    Hi sir, i want to split each and every row in excel as different workbooks can you pls help me?

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

      Then you don't need to unique value from advanced filter.

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

      Remove advanced filter from code

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

    Perfectly Worked. But Dear it is opening all exported files. This should not happen.

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

      You need to close workbook after exporting. I used in the code

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

      ****Working Code*****
      Sub Split_Master()
      Dim iRow As Integer
      Dim loopcounter As Integer
      Dim Rng As Range
      Dim wkb As Workbook
      iRow = Sheet1.Cells(Rows.Count, "A").End(xlUp).Row
      Set Rng = Sheet1.Range("A1:A" & iRow)
      'Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheet1.Range("M1"), Unique:=True
      Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheet2.Range("M1"), Unique:=True

      For loopcounter = 2 To Sheet1.Cells(Rows.Count, "M").End(xlUp).Row
      Sheet1.Range("A1:E1").AutoFilter Field:=1, Criteria1:=Sheet1.Range("M" & loopcounter).Value
      Set wkb = Workbooks.Add
      Sheet1.Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy
      wkb.Sheets(1).Range("A1").PasteSpecial xlPasteAll
      Selection.EntireColumn.AutoFit
      wkb.Sheets(1).Name = Sheet1.Range("M" & loopcounter).Value
      wkb.SaveAs "C:\Users\Ravindra\Downloads\Result\" & Sheet1.Range("M" & loopcounter).Value
      wkb.Close
      Application.CutCopyMode = False

      Next loopcounter
      Sheet1.AutoFilterMode = False
      End Sub

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

      But it will throw an error where data size is big. Error: 6

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

      @@ravindrabisht7372 what is the data size

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

      @@avitguru yes same I have done, it is fixed...shared in code as well

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

    Please provide video for merging separate excel files to one file for vba

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

      Already made this.

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

      th-cam.com/video/9KYVNHrY0as/w-d-xo.html

  • @hemanshuuttambhaitailor7184
    @hemanshuuttambhaitailor7184 7 หลายเดือนก่อน

    Want total also in same

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

    I am getting run time error 1004...with the comment - This cant be applied to the selected range, select a single cell in a range and try again..
    I copied the exact code but not working

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

      This will not work on selected range.

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

      @@avitguru i have not selected any range..its the same code

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

      @@anujafal1173 sorry for late reply, can you share me your code and error on my email

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

    Thanks Bhai G,Lekin ek question hai ki jab hum sheet open karte hai folder ja ke waha data autofit nehi ata hai uskeliye kya karna hai please

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

      Autofit karna padega

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

      Codeing kya hoga bhai g

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

      Kaha mention karna padega

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

      @@jaimajhi7227 Sheet1.Range("A").CurrentRegion.Columns.Autofit

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

      Wkb.Sheets(1).Range("A").CurrentRegion.Columns.Autofit
      Use this code after pastespecial

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

    Sir Naamaskar,
    Mujhe autofilter jo lagana h, usme, first row ko skip kar ke lagana h, send row se. Mere data me first row me kuch remarks dia hua h. aapne field autofilter field 2 direct select kar dia h, video me, please mujhe help kare sir, row no 2 se aur columns B se autofilter lagana h. Send mujhe ek summary bhi h usi file me dono sheet me ek sath loop laga kar seperate file banana h. Sir please help me.

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

      Filter to header pe lagana hai na
      Header kis row me hai apka

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

      @@avitguru sir, maine koshish kia h, ho gaya ye, thanks. But mujhe ek issue aa raha h, mere file me do sheet h, vo dono sheet ko kaise set kar VBA me. Mob 8802357077

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

      @@rahulyoutube209 ok I call you tomorrow

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

      @@avitguru thank you sir for your corporation.

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

    SIR ji, NIce
    please share us code !

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

      Share your email ID

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

      How to add Sub total after split Data .. please suggest us sir !

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

      @@bskrmusic3932 can you call me.

  • @k.k.sabariraj6484
    @k.k.sabariraj6484 2 ปีที่แล้ว +1

    I
    here I want to save my file in binary format what we do. ?

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

      Record a macro and save as binary, use same code

    • @k.k.sabariraj6484
      @k.k.sabariraj6484 2 ปีที่แล้ว

      @@avitguru I will try. and update

    • @k.k.sabariraj6484
      @k.k.sabariraj6484 2 ปีที่แล้ว

      @@avitguru not working sir.

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

      @@k.k.sabariraj6484 I will share code today

  • @AshutoshKumar-kg9cp
    @AshutoshKumar-kg9cp 2 ปีที่แล้ว

    Named argument not found ye error aa raha hai sir kya karu?

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

    Hi sir 2 excel sheet spareat karna hai to kaise kare..

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

      I have made video for also

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

      Search in Playlist

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

    Wkb.saveas is showing error 91
    Please help

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

      Can you send me image of code

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

    My work book isn't splitting in different workbooks ... It is showing error... you can't make work book more than 31 characters

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

      Then you need to set limit

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

      @@avitguru bhai apna number do

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

      @@artistdeepakmeena9591 7042009885

  • @k.k.sabariraj6484
    @k.k.sabariraj6484 2 ปีที่แล้ว

    EXCEL VBA MACRO FILE SAVE AS .XLSB format /Same sheet Name /Particular Folder
    Hi,
    Please help me to auto save an excel file with this below options by using VBA Macro.
    1. The workbook should save as Excel Binary format (.xlsb)
    2. The file name should be the same sheet name.
    3. The file should save as in particular folder.
    Thanks!

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

      I will share code today

    • @k.k.sabariraj6484
      @k.k.sabariraj6484 2 ปีที่แล้ว

      @@avitguru thks sir
      this viedo is not Available in youtube. here I m searching all channels.

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

      Sub SaveAsBinary()
      Dim FolderPath As String
      Dim StrWs As String
      Dim ws As Worksheet

      'You can change sheet name here in bracket
      Set ws = ThisWorkbook.Sheets("Macro")

      'Change folder path ends with \
      FolderPath = "C:\Users\akash\OneDrive\Documents\"
      StrWs = ws.Name

      ThisWorkbook.SaveAs Filename:=FolderPath & StrWs & ".xlsb", FileFormat:=xlExcel12, CreateBackup:=False

      End Sub

    • @k.k.sabariraj6484
      @k.k.sabariraj6484 2 ปีที่แล้ว +2

      @@avitguru 😍😍😍😍😍😍😍😍code working thks sir

    • @k.k.sabariraj6484
      @k.k.sabariraj6484 2 ปีที่แล้ว +1

      @@avitguru I need your contact details

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

    Not worked code.. Help me

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

      What is the issue

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

    WHY IS THE TITLE OF THIS VIDEO IN ENGLISH ????

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

    Sir kya aap coding ka file share kar sakte ho ?

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

      Yes. I can

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

      You can copy the code from below url
      www.avitguru.com/blog/how-to-split-spreadsheet-into-separate-workbooks-using-excel-vba/

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

      @@avitguru thank you so much sir. I am trying if I will face any difficulty i will contact you sir. Very nice and gorgeous trick sir. Very useful

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

      When I run this file I face error of dbug. How to solve it ? Pls help me

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

      @@nittalpatel1206 can you share error with me in whatsapp

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

    Sir aik request hai please attached practice file with vedios

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

      Ok I will upload file in drive and share links

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

      @@avitguru thanks sir jee
      I am waiting

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

      Sir mai ney split wale per try kia tha pre mj sy nehn bana
      Hm jo b new entry kary wo auto master sheet sy dosary sheet relfect ho
      Please is ka vedio baney ka
      Mj sy nehn hva try kia th

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

      @@mehboobali7543 ok, mai upload Kar dunga or file ka path description me paste Kar dunga

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

      @@avitguru saada Khush haro sir
      I am waiting

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

    pls code source

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

      Please send me mail I will send the code in your mail id

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

    Hi

  • @r.s.krishna6187
    @r.s.krishna6187 10 หลายเดือนก่อน +1

    good morning sir, i work with L&T Construction ,i can't one spilt master data some error showing, can share data for you mail id plz send me sir

    • @avitguru
      @avitguru  10 หลายเดือนก่อน

      Avitwebtraining@gmail.com

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

    Hi , It was wonderful vides with so simple step, i am trying VBA for the first time and Tried the code , however i am getting invalid or unqualified reference on Set.wkb.= Workbook. Below is the code, please help
    Sub Split_Master()
    Dim iRow As Integer
    Dim loopcount As Integer
    Dim Rng As Range
    Dim wkb As Workbook
    iRow = Sheet1.Cells(Rows.Count, "A").End(xlUp).Row
    Set Rng = Sheet1.Range("B1:B" & iRow)
    Rng.AdvancedFilter Action:=xlFilterCopy, CopytoRange:=Sheet1.Range("H1"), Unique:=True
    For loopcount = 2 To Sheet1.Cells(Rows.Count, "H").End(xlUp).Row
    Sheet1.Range("A1:F1").AutoFilter Field:=1, Criteria1:=Sheet1.Range("H" & loopcount).Value
    Set .wkb = Workbooks.Add
    Sheet1.Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy
    wkb.Sheets(1).Range("A1").PasteSpecial xlPasteAll
    Application.CutCopyMode = False
    wkb.Sheets(1).Name = Sheet1.Range("H" & loopcount).Value
    wkb.SaveAs "\\File\dateosrt \" & Sheet1.Range("H" & loopcount).Value & ".Xlsx"
    wkb.Close

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

      You have written Set .wkb = workbooks.add this is wrong
      Write
      Set wkb = workbooks.add

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

    Sub Split_Master()
    Dim iRow As Integer
    Dim loopcounter As Integer
    Dim Rng As Range
    Dim wkb As Workbook

    iRow = Sheet1.Cells(Rows.Count, "B").End(xlUp).Row
    Set Rng = Sheet1.Range("B1:B" & iRow)
    Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheet1.Range("M1"), Unique:=True

    For loopcounter = 2 To Sheet1.Cells(Rows.Count, "M").End(xlUp).Row

    Sheet1.Range("A1:E1").AutoFilter Field:=2, Criterial:=Sheet1.Range("M" & loopcounter).Value
    Set wkb = Workbooks.Add
    Sheet1.Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy

    wkb.Sheets(1).Range("A1").PasteSpecial xlPasteAll
    wkb.Sheets(1).Name = Sheet1.Range("OK" & loopcounter).Value

    wkb.SaveAs "B:\test\" & Sheet1.Range("OK" & loopcounter).Value & ".xlsx"
    wkb.Close

    Application.CutCopyMode = False

    Next loopcounter
    Sheet1.AutoFilterMode = False


    End Sub
    Named Argument not found error is coming on line
    Sheet1.Range("A1:E1").AutoFilter Field:=2, Criterial:=Sheet1.Range("M" & loopcounter).Value

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

      Write Criteria1 instead of Criterial

  • @nadimkhan-lm3ki
    @nadimkhan-lm3ki 2 ปีที่แล้ว

    Sub Split_Master()
    Dim iRow As Integer
    Dim loopcounter As Integer
    Dim Rng As Range
    Dim wkb As Workbook

    iRow = Sheet1.Cells(Rows.Count, "D").End(xlUp).Row
    Set Rng = Sheet1.Range("D1:D" & iRow)
    Rng.AdvancedFilter Action:=xlFilterCopy, copytoRange:=Sheet1.Range("I1"), Unique:=True

    For loopcounter = 2 To Sheet1.Cells(Rows.Count, "I").End(xlUp).Row

    Sheet1.Range("A1:G1").AutoFilter field:=4, criteria1:=Sheet1.Range("I" & loopcounter).Value
    Set wkb = Workbooks.Add

    Sheet1.Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy

    wkb.Sheets(1).Range("A1").PasteSpecial xlPasteAll
    Application.CutCopyMode = Flase
    wkb.Sheets(1).Name = Sheet1.Range("I" & loopcounter).Value

    wkb.SaveAs "C:\Users\Country\Country 2\" & Sheet1.Range("I" & loopcounter).Value & ".xlsx"
    wkb.Close

    Next loopcounter

    Sheet1.AutoFilterMode = False

    End Sub
    Run time error '1004'
    Method 'SaveAs' of Object '_Workbook' Failed,
    please help on this, this is my first time in VBA

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

      Please run this code Step by step and let me know on which line you are getting an error.

    • @nadimkhan-lm3ki
      @nadimkhan-lm3ki 2 ปีที่แล้ว

      wkb.SaveAs "C:\Users\Country\Country 2\" & Sheet1.Range("I" & loopcounter).Value & ".xlsx"
      this line im getting error

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

      @@nadimkhan-lm3ki ok, check value of sheet name

    • @nadimkhan-lm3ki
      @nadimkhan-lm3ki 2 ปีที่แล้ว

      @@avitguru Thanks for your help :), i need one more help like i have total 700 worksheets and i want date wise like AU-AUS 19-04-2022, so here i need to update the date
      wkb.Sheets(1).Name = Sheet1.Range("I" & loopcounter).Value

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

      @@nadimkhan-lm3ki It will work.