VBA to BROWSE & COPY Data from SELECTED File in Excel

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

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

  • @LeilaGharani
    @LeilaGharani  10 หลายเดือนก่อน +1

    Grab the file I used in the video from here 👉 pages.xelplus.com/vba-select-file

  • @ronvds4713
    @ronvds4713 5 ปีที่แล้ว +18

    Most people I deal with look at spreadsheets as a glorified calculator and are amazed at what I do for them. And then you come along and I am amazed.

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว +6

      I'm glad I can still surprise you :)

  • @Matt-zp9jg
    @Matt-zp9jg 3 ปีที่แล้ว +14

    For those wanting their copied range to be a bit more dynamic use this.
    OpenBook.Sheets(1).Range("A2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select
    Selection.Copy
    The only problem with this is it stops if there are any empty rows. So make sure to check your data!
    LastRow = Sheets(1).Cells(Sheets(1).Rows.Count, StartCell.Column).End(xlUp).Row
    LastColumn = Sheets(1).Cells(StartCell.Row, Sheets(1).Columns.Count).End(xlToLeft).Column
    Sheets(1).Range(StartCell, Sheets(1).Cells(LastRow, LastColumn)).Copy
    This code on the other hand will work and count data even if there any empty rows between data. I'm still trying to incorporate this code into her macro to work so far no luck haha!

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

      ThisWorkbook.Worksheets("HW15").Range("A1").PasteSpecial xlPasteAll
      At this part, I am encountering error, that highlights this as yellow.
      Can somebody help?
      While my colleague uses the same code, but works fine.

    • @Matt-zp9jg
      @Matt-zp9jg 2 ปีที่แล้ว

      @@danieljosiahquijano5659 Could be many things: possible your code has not selected anything to copy. Paste will fail if nothing copied. Your range is different than your paste area.
      Also better to use this: high lighting entire column a even Blanks.
      Dim rng As Range
      Set rng = Range("A2", Range("A" & Rows.count.End(xlup).Address)
      rng.Copy
      Range("B2").PasteSpecial xlPasteAll

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

      @@danieljosiahquijano5659 Did you figure it out? I'm have the same problem :/

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

      @@johnhayse7147 I did, when you are recording a macro, under "Store macro in", select dropdown "This Workbook". it is a very specific code.

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

      @@danieljosiahquijano5659 Thanks!

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

    Well, in less than a year, you've become the number one as reference ... Everything is useful in your TH-cam channel..😍

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      Thank you, that makes me very happy :)

  • @djdisasterjames
    @djdisasterjames 4 ปีที่แล้ว +7

    These lessons are so awesome, you really dive into every little detail and explain it so clearly :) Dim as String --> False = "False". Dim as Variant --> False = False :D I was baffled by that once, no doubt others also benefited from this!

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

      I'm glad the tutorials are helpful for you James.

  • @coffeecuppepsi
    @coffeecuppepsi 5 ปีที่แล้ว +44

    If someone doesn't like spreadsheets its just that they haven't seen this channel

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

      So true!

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

      Or because spreadsheets are the wrong tool for the job most of the time

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

      I am trying to find a VBA code that will find a file utilizing where only the first six characters in the file name are always same and the file name ends with YYYY.MM.DD.xlsx.
      now my file is under 2020 folder and have to create seprate folder for each monts like Jan, Feb and Mar under 2020 folder, then in the each month file we have to change and create file on daily basis
      like this _ Y:\C & C FEES\Suresh\anbu 2020\04_Apr 2020\InvoicesDD.MM.YY(daily need to change the file date and monthly once change the month).

  • @shabbirkanchwala-abwaab6263
    @shabbirkanchwala-abwaab6263 5 ปีที่แล้ว +7

    Very useful hints
    B4 I never thought that such can be done in excel
    I always gain a lots of practical knowledge from your Vdo
    Simply U R Gr8!!!

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

    This is something I'll actually use so thank you. And also You strike me as very pedagogical so I'll have a look-see if your courses are something i can take parallel to my work.. Fascinated by excels power. Mostly becaus it lets me "program" some simple things without the need to upgrade my IT security clearance in the organisation. As long as I'm within excel boarders. I'm allowed to build "smartnes" 💡

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

      I know exactly what you mean Thomas. Been in the corporate world myself for quite a while trying to navigate around the IT guidelines :)

    • @MrKallemyran
      @MrKallemyran 5 ปีที่แล้ว

      @@LeilaGharani ha ha Don't say it so loud ;) anyway... I have enrolled.. Now I have to find some time ⏳

  • @Thurmanatr16
    @Thurmanatr16 5 ปีที่แล้ว +4

    Never a dull video! 🙂Thank you for sharing your expertise with Analysts across the Corporate world. 😃

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

      I'm glad if my videos are helpful in the corporate world :)

  • @lephterisp
    @lephterisp 5 ปีที่แล้ว

    A whole new(amazing) world hidden behide Excel .Learning VBA is the next target for me.Thanks again for all you give to us .

  • @mellowkoopa
    @mellowkoopa 5 ปีที่แล้ว

    This came up in my Google news feed, like sweet nectar of information magic'd down from the heavens to solve a problem I didn't know I had. Thank you so much for your very clear and concise tutorial. Subscribed.

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      You're very welcome. I'm glad to have you here.

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

    Thank you. Finally someone who explains this stuff very well?

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

    I’m getting into excel and love this stuff. Thank you.

    • @LeilaGharani
      @LeilaGharani  23 วันที่ผ่านมา

      Glad you enjoy it!

  • @Jihad-f3e
    @Jihad-f3e 29 วันที่ผ่านมา

    Very nice explanation, bless your efforts

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

    I really learn new things every time I watch your videos. Thanks a lot! :D

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

    You are truly amazing and a very gifted teacher. Thank you for all you do!!

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

    I’m doing the VBA course at the 😆moment. Very impressive, well structured and well explained stuff. Great job Leila 👍

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      That's great Craig. I'm glad you like the course. Many thanks for the feedback!

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

    Thank you for the valuable information, i have purchased all of your courses from udemy. They are so very helpful

  • @jmstampe
    @jmstampe 5 ปีที่แล้ว +5

    Between this and ADO....these are my two faves to impress the non-technical

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

    TYSM for such an informative instruction, help me a lot 🥰

  • @NikunjDM
    @NikunjDM 5 ปีที่แล้ว

    हर बार कुछ नया ,धन्यवाद लीला

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

    Your channel is brilliant!
    I learn so much. Thanks!

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

    Thank you so much!! Extremely helpful video!!

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

    you are just awesome

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

    Wow
    I was actually using "Path" option in excel all this long...this really help...Thanks

  • @arifhk007
    @arifhk007 5 ปีที่แล้ว

    I like your videos from other youtube videos...Coz your teaching style is very helpful and clear!
    Thank you, Mam!

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

      I'm very glad to hear that :)

  • @anomolyreport
    @anomolyreport 5 ปีที่แล้ว

    And here I thought openfiledialog and filesystem objects are the only ways to get file names..
    Thank you!!

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

    Great!!!
    It is exactly what I was looking for!!!
    You are the best!!!

  • @smohanv
    @smohanv 5 ปีที่แล้ว

    This is a kind of VBA idea i was searching for. Thanks. I have subscribed to this channel as well. Thanks a million.

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      Glad to help. It's great to have you here.

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

    Great Video 👍🏻.. thanks for sharing

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

      Thanks for the lightning fast comment Faraz :)

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

    Awesome job, Leila! I can see myself using this in the future.

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      That's good to hear Bobby.

  • @Things-Recycleing
    @Things-Recycleing 5 ปีที่แล้ว

    Thanks for usual support in Excel every day learn new topic

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

    Very good Leila!!! than
    ks for this video!!!

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

    Hi Leila. Great tutorial! Thanks for sharing this :)) Thumbs up!!

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

    Thanks this really helped me out. Clear and not boring!

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

    Thanks for this useful lesson, you are the best 👏👏

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

    Very useful thanks a lot, Keep it up.

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

    Thanks! Always very helpful!

  • @jayeshjamtani924
    @jayeshjamtani924 5 ปีที่แล้ว

    Thank you #LeilaGharani #ExcelQueen for sharing this wonderful way to open files. I am a big fan of yours ( more than of Excel )

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      I'm happy to hear that :)

  • @abdallah.kandiel
    @abdallah.kandiel 5 ปีที่แล้ว

    Happy Thursday your highness
    This is not fair, you publish your jewels while me at work.😅
    I can't return to my firsts💪
    Anyways
    You are the one
    I'll brb after watching
    Thanks in advance ♥

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

      First or not I'm always happy to see your comments :)

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

    Great video, actively using it currently. I only had one question regarding the macro: is there any way to change the default file open location to be context sensitive? For clarity: is it possible running this macro to have the default window open up to where the file is currently located in a dynamic fashion? We are trying to do this because we have many different folders with various data sets. I'm trying to think of a way to have the default window open up to the local folder, but be context sensitive. So if the excel file is moved the default dialogue box will change depending on the location of the workbook. Thanks in advance for anyone that can help.

  • @vengamanaidu996
    @vengamanaidu996 5 ปีที่แล้ว

    You are my teacher madam, i learned lot from you

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

    Very useful ❤. Thank you so much 😊

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

    As always, excellent Top-Notch Pure explanation...

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

    amazing!!! do you have a video on how to import multiple files?! 😊

  • @sasavienne
    @sasavienne 5 ปีที่แล้ว

    Excellent.. Thank you very much for sharing your valuable knowledge with us Leila. 👍 👏 🌟

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

      You're very welcome. Glad you like it.

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

    Hi, this is very helpful. would you explain considering the csv file instead xlsx file, copy data from sheet 1 of csv file opened and paste in the current workbook. Thank you

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

    Hi Leila. This video has really helped in one of my excel project of my process flow. I sincerely appreciate you for making this video. I would have loved to share my automation made out of this information, but, considering confidentialty, not possible. Thanks again for making and sharing. Will also go through your other videos.

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

    Good one...btw, how can someone dislike this video ?

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

    Thanks for this video and it is really helpful but how to create data should select and copy data dynamic

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

    Best 👏 Channel 👏 EVER!!! 👏

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

    Thanks! I was able to use your method perfectly :)

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

    u r my excel hero

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

    hi, thank you for lots of tutorials you made. appreciate if you continue or added the program to paste on the last row please. TIA.

  • @yulinliu850
    @yulinliu850 5 ปีที่แล้ว

    Great teaching of VBA. Thanks Leila!

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      You're very welcome. Glad you like the tutorial.

  • @Llb890
    @Llb890 5 ปีที่แล้ว

    this is the way to increase knowledge

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      Glad the tutorial is useful.

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

    beautiful mind , and good teacher , thank you leila .

    • @craiggibson8547
      @craiggibson8547 5 ปีที่แล้ว

      @tha2ir Talib beautiful teacher, and good mind, thank you leila .

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

    It is great!!!
    Thank you so much for this very valuable information.

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

    Amazing, this saved me so much time :)

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

    Great help thank you 😊

  • @rahulbakshi285
    @rahulbakshi285 5 ปีที่แล้ว

    Thanks Leila, I got your VBA videos.

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

      That's great Rahul. Thanks for your support.

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

    Great videos as always. I have signed up for some courses of yours to learm more. You are geat teacher. you mentioned that " and copy specific ranges and import them in our file will be shown later how to do". Can you give example of this or tell me lesson no in you course that explains this as I could not find it. Thank you once again for great courses and video content.

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

    Very useful and practical. Thank you for the great material!

  • @farizpatah4081
    @farizpatah4081 5 ปีที่แล้ว

    Finally got this macro.. Thanks a lot...

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

    Wonderful video!

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

    Hi, i really like how easily and precisely you explain things. I have a query though, what should i do if i want to get data by opening a link which is a link to excel sheet and not from any worksheet which is saved in my PC.

  • @sarfarajkureshi6569
    @sarfarajkureshi6569 5 ปีที่แล้ว

    Nice tutorial mam. God bless you

  • @ฉันเรียนไปเรื่อย

    Thanks a lot. it is usefully for me

  • @shaheershujaat2223
    @shaheershujaat2223 5 ปีที่แล้ว

    Wow Leila you are looking very nice beautiful and amazing video well done 😊😊❤️❤️👍👍

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

      Thank you, glad you like it :)

    • @shaheershujaat2223
      @shaheershujaat2223 5 ปีที่แล้ว

      My pleasure Leila yup a lot 😊😊❤️❤️👍👍

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

    Well done. Very easy to follow and understand. How would handle a dynamic range in OpenBook?

  • @joecross5335
    @joecross5335 5 ปีที่แล้ว

    Helpful. I didn't know that method existed.

  • @ראזיכיסראוי
    @ראזיכיסראוי 2 ปีที่แล้ว

    BIG THANKS LAILA

  • @JG-fg1ye
    @JG-fg1ye 5 ปีที่แล้ว

    excel-lent as always, Leila is stunning 👍🏻

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

    Wish I could do that :) :) I am enrolling to your course for sure.

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

    Really good!

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

    You rock the item. Super

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

    Amazing! Really helpful :-)

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

    Hi Leila and thank you very much for your useful videos!
    I have a problem with this code - it doesn`t work on MAC.
    Do you have a solution for this ?
    Thank you!
    Best regards!

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

    Great video, very easy to understand. How to copy the entire column A & B without setting a range number?

  • @nielskock3221
    @nielskock3221 5 ปีที่แล้ว

    absolutely awesome thanks. Actually just what I was looking for thanks!

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      My pleasure Niels. Glad to help.

  • @robertakwasiadjei8223
    @robertakwasiadjei8223 5 ปีที่แล้ว

    Very much grateful Leila.

    • @LeilaGharani
      @LeilaGharani  5 ปีที่แล้ว

      You're very welcome Robert!

  • @Khalnayak_sanju143
    @Khalnayak_sanju143 5 ปีที่แล้ว

    Wow thank you mam ,it's helping me on my work Thanks Once again

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

      My pleasure, glad to help.

  • @youzaist
    @youzaist 5 ปีที่แล้ว

    You are the best ever.... life saver oh my gosh

  • @mohdkharish8169
    @mohdkharish8169 5 ปีที่แล้ว

    Thanks a lot.. Awesome.. for next can you update for select file with multiple file.. Thanks

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

    In column A I have file name
    In column B I have source folder
    In column C i have destination folder
    Need a macro
    To copy files of column A
    From source path (columnB)
    To destination path (columnC)

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

    Woah! Just what I needed. Thanks! :D

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

    I work in a hotel as a night Auditor. Someone managed to do his job at a fraction of a time because of time. Been trying to find out how he could import the report from our opera cloud into our excel. In a form of a format. This video gives a good example but I still need help. 😮

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

    Amazing as always.

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

    Thank you so much

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

    Thanks mam for this useful code।❤️❤️❤️

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

    This is what I've been looking for for my reporting! thanks so much. How about before pasting to destination sheet, a prompt or option to select the new range will be prompted or even paste data to the next blank row below the 1st copied file, is that possible? pls. thanks

  • @yurd563
    @yurd563 5 ปีที่แล้ว

    Thanks for video!

  • @gamingstudio9949
    @gamingstudio9949 5 ปีที่แล้ว

    Very nice video

  • @rodrigodavalle5738
    @rodrigodavalle5738 5 ปีที่แล้ว +3

    This is great! Thank you so much. I would like to know how should I change the code in order to paste the range in the active cell?

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

      Try using: Range(cell("address")

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

    Excellent! Thank you :)

  • @ImranKhattak-me1lw
    @ImranKhattak-me1lw ปีที่แล้ว

    Hi Leila Gharani ! i always concern your videos when i face some issue in my macro code. perfect videos highly recommend, how can i learn all the Vba techniques quickly and efficiently please guide me . Regards

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

    This is really great !! But would like to understand how can we apply filter on the selected file based on a certain criteria and copy only the filtered data on the macro workbook.

  • @excelaficionado
    @excelaficionado 5 ปีที่แล้ว

    Awesome video as always....

  • @walelaiouattara4882
    @walelaiouattara4882 5 ปีที่แล้ว

    Thanks, nice and helpfull.

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

    Love it, thanks. Simple and effective. Used it to automate my tax calculations for GME tendies ❤