Excel VBA to Save Data to Another Workbook

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

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

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

    VBA/Macros Course (40% Discount): www.teachexcel.com/vba-course-update.php?src=youtube_pinned_comment_hgyMrkVWw-o
    200+ Video Tutorials - 200+ Downloadable Excel Reference Files - 50+ Hours of Content

  • @wishboneattack
    @wishboneattack 4 ปีที่แล้ว +9

    If you want to be sure it saved instead of just a msgbox that is basically telling you the macro has ended, you can add an IF statement using the two lines he already gave you to do a simple verification check. Put this right above wbMaster.Close True
    IF wbMaster.Worksheets("Data".Cells(masterNextRow, 1).Value = wbLocal.Worksheets("Input").Range("F3"). Value And wbMaster.Worksheets("Data").Cells(masterNextRow, 2).Value = wbLocal.Worksheets("Input").Range("F5).Value Then
    MsgBox "Part Saved"
    Else
    MsgBox "Part not saved correctly"
    End IF

  • @timparke3305
    @timparke3305 3 ปีที่แล้ว +4

    Exactly what I was looking for... Thank You!!!!

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

    Great video - the one piece that I am looking for is how to assign a path name for a file on Onedrive that I want to update, not a local workbook. Is there more to it than just the correct path name? When I look at the file path for the Onedrive it shows me a link.
    Thanks in advance

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

    Sir... Great video.... What about same work book and we only have sheets for form to data base.... Bot another workbook.... I am a beginner.... Thank you sir

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

    thank you, with little adjustment i'm able to finish my work

  • @wayneedmondson1065
    @wayneedmondson1065 4 ปีที่แล้ว +3

    Fun one! I hacked out my own solution before watching the video. Picked up some good tips from your detailed lesson. Thanks for sharing. Thumbs up!!

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

    Hi, may I know how I can save the data without opening the excel workbook using only the vba excel form.

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

    How can I run this same code, but with the feature of keeping the vbMaster open while using the input source? I would like to see the data entry happen side by side and not have the master file automatically close each time an input is "saved". Thanks!

  • @shriharibhat6655
    @shriharibhat6655 4 หลายเดือนก่อน

    Thank You for the informative video.
    I would just like to know how we can transfer range of values. I tried inserting the range in the inverted commas, but it is taking only value of the 1'st mentioned cell. If anyone could please help me with it would be great help.
    Thanks Anyways :)

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

    Very useful for me. Thanks
    I have macro based excel sheet but how to share for multiple user entry. Please suggest.

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

    Really Nice Simple Bit Of VBA Code Thumbs Up...Thank You Sir :)

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

    AB AN ERROR: thank you so much for your share and contribution us. i want to ask a question: normally this code run well but when i open another workbook i receive "RUN TIME ERROR NO 9", how can i fix this? (when i close the other workbook code starts well again) thanks a lot in advance!

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

    I need to do this but copy a full table over what changes do I need

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

    Thanks a lot for this!!!

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

    Thank you for sharing. But I found an error in the line of masterNextRow- subscript error.

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

    Thanks. It's very useful. But can we have multiple copy of the input worksheet at clients side and data can be inputed at a time from multiple worksheets?

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

      Sure, you can have all sorts of setups like this! VBA allows you to do a lot - if you're interested in learning how to do a lot more than I showed in this tutorial, you can look at my new VBA Course: www.teachexcel.com/vba-course-update.php?src=yt_comment_reply

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

    I encountered error on masterNextRow it says subscript error

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

    Dear Sir,
    want to transfer data from one workbook to another workbook
    workbook -A
    1. Receipt No.
    2. Date
    3. Name
    4. Amount
    to Workbook - B in two different Sheets.
    can you please help me write correct VBA code.

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

    Hiii.. if my closed workbook stored in online how to mention the file path?

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

    alright, what if I don't want to make duplicate entries but update an existing entry with additional/different information

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

      Hi Travis, that is totally possible and I cover pieces of this puzzle in many of the tutorials I've made here on TH-cam (you can search for them on my channel) and also in my full VBA course: www.teachexcel.com/vba-course-update.php?src=yt_comment_reply_hgyMrkVWw-o

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

    Is there a way to keep the values entered in the form instead of them disappearing when you hit save?

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

      Hmm at about 11 minutes in, he added two lines of code that is responsible for clearing those entries... you could leave those two lines out, and it won't disappear.

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

    I have application outside procedure error in each line

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

    i'm using ur command in VBA but its so weird that whatever I entered it will overwrite the 1st entry and always become a new entry. able to resolve? Thanks

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

      Well it depends on a lot. I'd go over to our forum on www.teachexcel.com and upload the sample files you are working with and ask there - its much easier when the code and issue you are specifically mentioning is visible.

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

    Thank you so mutch

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

    Why won’t my workbook file location work?

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

    Sir what if I rename master workbook or chane location?

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

      Shouldn't matter if its the Master workbook with the code in it.

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

    Is there a way that one can globally print all the codes ( Modules, Macros,....) in a an Excel file ( Workbook) to review, cross over,.... to be able to alter some without creating a catastrophe?

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

    How to save Data to another tab none vba pls

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

      Well, probably copy/paste is the simplest way or copy/paste special values (Ctrl + C > Alt + E + S + V Enter) Otherwise, I'm not sure exactly what you mean by saving the data - if you can upload a sample file, you should ask in my forum and it will be much easier to help you. www.teachexcel.com/talk/microsoft-office?src=yt_comment