Excel VBA: Referring to Ranges & Writing to Cells (Range, Cells, Offset, Names)

Поділитися
Вставка
  • Опубліковано 4 жов 2024

КОМЕНТАРІ • 262

  • @LeilaGharani
    @LeilaGharani  8 місяців тому

    Get access to the full Excel VBA course here 👉 www.xelplus.com/course/excel-vba-excel-macros/

  • @mariarib6504
    @mariarib6504 Рік тому +1

    omg. I'm not getting much sleep. I keep learning more from you and instead of fixing the basic stuff I have written, I am thinking of other things I can do! Thank you :-)

  • @Yolande26
    @Yolande26 4 роки тому +6

    Leila has the best Excel tutorials/videos by far! I did two of her courses and she is simply the best instructor!

  • @rnunez047
    @rnunez047 2 роки тому +1

    In Spanish-language there's not channel like this one. Great, you have a nice voice, even my native language is Spanish, i get all you explain. I just founded you. Congratulations "Desde américa Latina, Nicaragua. Saludos"

  • @aricosman5354
    @aricosman5354 3 роки тому +4

    GOD bless you Mrs Leila, Thanks a lot for your tutorials

  • @TheDutchGemini
    @TheDutchGemini 3 роки тому +13

    VBA allows to specify ranges using the short notation with square brackets instead of the Range() or Cells() property. For instance 'Range("A1").Value' can be written in short as '[A1].Value'. This is also true when using areas, for instance [A2:C2].Value = "2nd", and named ranges such at [LastOne].Value = "10th".

  • @chandrasekharboya8885
    @chandrasekharboya8885 4 роки тому +4

    Hi Leila, Really really impressive explanation of cell referencing. This is the best video explaining the cell references.
    Thank you.

  • @ismailismaili0071
    @ismailismaili0071 6 років тому +1

    I think I started to understand VBA with you thank you so much Ms. Leila

  • @lawrenceward2366
    @lawrenceward2366 5 років тому +1

    New to VBA. Most useful video I have seen. Thank you.

    • @LeilaGharani
      @LeilaGharani  5 років тому

      I'm very happy to hear that Lawrence. Glad you like the video.

  • @mehdihammadi6145
    @mehdihammadi6145 6 років тому +2

    I am one of those who believe that there is always something to learn. And this has just been verified once again. Although I have been writing VBA code for years, I have never used the shortcut "?" in the immediate window because I used to write the entire debug.print command. So thank you very much Leila for this

    • @LeilaGharani
      @LeilaGharani  6 років тому +1

      Hi Mehdi. I'm glad you found something new here. Actually I was also not aware of the "?" method for the longest time after I started to use VBA. It made me very happy when I discovered it :)

    • @mehdihammadi6145
      @mehdihammadi6145 6 років тому +1

      Hi Leila, for the history this is an old (legacy) command coming from old versions of Basic. If my memory is good I used it with gwbasic for more then 25 years ago :)

    • @LeilaGharani
      @LeilaGharani  6 років тому

      Thanks for the info :)

  • @lilanthawijerathne3085
    @lilanthawijerathne3085 3 роки тому

    Hats off to Leila ! . I learns lot from your videos.

  • @PremKumar-pq5lr
    @PremKumar-pq5lr 3 роки тому +1

    Used this techniq and solved a issue for which i am looking for a solution in long time. Keep rocking😎👏✌

  • @rag7628
    @rag7628 5 років тому +17

    Hello Leila, I've been working now through some of your great tutorials here and now I really have to make you a big compliment.
    Thanks sooooo much for the great work you a doing here, it's really a great performance.
    Your tutorials are very well structured and very easy to understand and extremely helpful. Thank You :-)

  • @alwysrite
    @alwysrite Рік тому

    was looking for multiple range syntax and found it here after looking on various sites. Thank you

  • @AamirSaeedTajalli
    @AamirSaeedTajalli 5 років тому +1

    Lady Leila, I LOVE YOU for making this wonderful tutorial. Excellent TEACHER.. knowing the art of MAKING UNDERSTAND.
    Thanks a lot.

    • @LeilaGharani
      @LeilaGharani  5 років тому +1

      I'm very happy to hear this Aamir! Glad you like the videos.

    • @AamirSaeedTajalli
      @AamirSaeedTajalli 5 років тому

      @@LeilaGharani i started watching your tutorials 3 days back and the more i am diving in, the more i am learning "FAST" and more i am liking your WAY of teaching. Full of confidence, command, knowledge and patience. GREAT WORK and inspiring achievements. Getting convinced to join your online tutorials paid version. I hope they will be even better.

  • @teachmeteachme9014
    @teachmeteachme9014 3 роки тому

    You're creative, so I've decided to outdo you in this field. تحية لك من المغرب

  • @abumalik97
    @abumalik97 3 роки тому

    impressive teaching ability , right pace and right details . subscribed !.

  • @davecks3042
    @davecks3042 4 роки тому +3

    I did enroll in Udemy in Leila VBA course and I learned immensely. Thanks

  • @LuisGarcia-mn4jg
    @LuisGarcia-mn4jg 3 роки тому

    You explain concepts very well and it is easy to follow. Thanks

  • @scorpio19771111
    @scorpio19771111 2 роки тому

    Excellent video. You are great instructor, and the video is top-notch in clarity.

  • @MyChannel706
    @MyChannel706 4 місяці тому

    Excellent video and narration! Thank you!

  • @j.fabricioelias227
    @j.fabricioelias227 7 місяців тому

    Thank you! This video gave me an excellent explanation about cells and ranges referencing.

  • @SugarKane9547
    @SugarKane9547 3 місяці тому

    Thanks Leila,
    You just cleared up a lot of confusion I had about vba range referencing. I am very grateful......and YES, I like what I see but someone already subscribed before me! :)

  • @YogeshSharma-ui7xx
    @YogeshSharma-ui7xx 3 роки тому

    Leila you r awesome and nicely explains with smile and simple way. Thank u

  • @umeshthadhani6388
    @umeshthadhani6388 4 роки тому +1

    So Clear Explanation....!!! Makes understanding simple.! :) thank you So Much !! :)

  • @ca.lakshminarayanreddyjamb9087
    @ca.lakshminarayanreddyjamb9087 5 років тому +6

    I like the way you explain. Really awesome!!! Thankyou.

  • @mobr.
    @mobr. 5 років тому +4

    Clear, concise, and informative. Thank you.

  • @dasrotrad
    @dasrotrad 6 років тому +2

    This is really great Leila. Love your presentation and excellent explanations. It is very well thought out. You make it easy to understand. When Mike Girvin is following your videos, you know you are among the great. Thank you so much for sharing.

  • @marioalfredooviedo
    @marioalfredooviedo 5 років тому

    buenos principios excel, tienes un gran poder de enseñar, hay personas que creen que solo se debe enseñar lo mas astral, pero los principios de excel son excelentes, te felicito

    • @LeilaGharani
      @LeilaGharani  5 років тому

      Thank you Mario. Glad you like the video.

  • @abdallah.kandiel
    @abdallah.kandiel 6 років тому +2

    Thankd leila
    Back to our happy day
    Waiting for the end to learn about the course
    Good luck ur highness

    • @LeilaGharani
      @LeilaGharani  6 років тому +1

      You're welcome.
      It's happy Thursday :) Wish you a great rest of the day.

  • @pponcho8245
    @pponcho8245 2 роки тому

    Thank you for teaching the basics!!!!

  • @cobusoosthuizen5223
    @cobusoosthuizen5223 6 років тому +1

    Thanks Leila, nice preparation for the upcoming course

    • @LeilaGharani
      @LeilaGharani  6 років тому

      You're welcome Cobus & thank you.

  • @steamsteam6607
    @steamsteam6607 4 роки тому +2

    Such a smart, beautiful woman. Iran makes great things. Thank you for these videos.

  • @cekhattaq
    @cekhattaq 3 роки тому

    Explanation is in very nice & systemic way, Thanks

  • @joecampanini8154
    @joecampanini8154 3 роки тому

    Outstanding presentation. Thank you.

  • @sasavienne
    @sasavienne 5 років тому +4

    Cells.Columns.Autofit is lovely.
    Leila gets 🌟 🌟 🌟 🌟 🌟

  • @ah244895
    @ah244895 5 років тому +1

    Very clear, understandable. Great way to learn Excel m

  • @abdullahalklbani7454
    @abdullahalklbani7454 3 роки тому

    Amazing 👏 that was full comparhansive explanation 👏
    I appreciate that efforts from your side
    This is was very helpful

  • @arielponce8586
    @arielponce8586 4 роки тому

    You are an awesome teacher.

  • @SanjayKumar-yx6gc
    @SanjayKumar-yx6gc 6 років тому

    Very useful lecturer Leila , Thank you so much.

  • @MrWofty
    @MrWofty 4 роки тому

    Oh Wow, solved my problem in a few easy minutes, well explained.
    I wish my school teachers, College Tutors etc, were like this.
    Thanks for giving me some enjoyment with learning :)
    I used this in Excel VBA "A1", "A" & lRow,
    Where lRow was the last row number.
    Cheers :)

  • @sarwansingh9423
    @sarwansingh9423 4 роки тому

    This was very helpful

  • @Vicky-bl9pr
    @Vicky-bl9pr 3 роки тому

    You are the best😊😊👌👌👌

  • @sanjaykulkarni1800
    @sanjaykulkarni1800 6 років тому +2

    Excellent way of explaining.. Thanks.

  • @Mario112352
    @Mario112352 3 роки тому

    Very nice presentation
    Look forward to your course

  • @ringsfieldvillagehallvilla7970
    @ringsfieldvillagehallvilla7970 4 роки тому

    This is fantastic. I will be taking the course at some point in the future.

  • @irfanmansoori3060
    @irfanmansoori3060 3 роки тому

    Unbeatable knowledge Leila.. thanks..

  • @andydidyouhear
    @andydidyouhear 3 роки тому

    Great lecture, easy to follow.

  • @sasavienne
    @sasavienne 5 років тому +1

    Brilliant. I like your videos Leila. Thanks a million.

    • @LeilaGharani
      @LeilaGharani  5 років тому +1

      Thank you! I’m glad to hear that.

  • @stevennye2441
    @stevennye2441 3 роки тому

    excellent review!

  • @helenasvensson6595
    @helenasvensson6595 11 місяців тому

    So well explained, as always!

  • @jokkiossaka3306
    @jokkiossaka3306 5 років тому

    Thank You Leila for your time and cool video !

    • @LeilaGharani
      @LeilaGharani  5 років тому

      My pleasure Jossi. Glad you like the video.

  • @BOWENSblog
    @BOWENSblog 4 роки тому

    This is a good hobby

  • @joem112
    @joem112 6 років тому

    Very good video. I liked the way you did the drag and drop with the named range...pretty cool way to do that.

  • @MrYegneswaran
    @MrYegneswaran 5 років тому

    Very much insightful.. No need to refer to any other material as far as Range object though VBA..👍👍👍

  • @sindhusudhakaran1731
    @sindhusudhakaran1731 3 роки тому

    so well explained. Thank you

  • @ckokse
    @ckokse 6 років тому +4

    Thursday is my favorite day! I was already wating for your new video. This is great, will practice this as you instructed. I want to be prepared for when the VBA course finally comes out.

    • @LeilaGharani
      @LeilaGharani  6 років тому

      Mine too! Great. Practice is always good :))

  • @SolomonKinyanjui_sk
    @SolomonKinyanjui_sk 6 років тому

    Hello Leila the lesson to day was very clear. Keep it up.

    • @LeilaGharani
      @LeilaGharani  6 років тому

      Thank you Solomon. Will do my best :)

  • @yoryopower2908
    @yoryopower2908 3 роки тому +1

    Thank you.

  • @thirdfabe167
    @thirdfabe167 6 років тому +1

    really awesome,,i acquired a lot of knowledge in your video.

  • @alanrobbo6980
    @alanrobbo6980 Місяць тому

    Fantastic, Thanks.

  • @sarasamin
    @sarasamin 5 років тому +1

    Superb! Excellent!Thank YOU!

  • @1gopalakrishnarao
    @1gopalakrishnarao 6 років тому +1

    Thanks a lot Madam, very inspiring, illuminating, impressive, inquisitive & revealing, . Explanation is superb, very articulate. On behalf of all my Excel learner friends A BIG SALUTE TO MY BELOVED BEAUTIFUL TEACHER.

    • @LeilaGharani
      @LeilaGharani  6 років тому

      Thank you very much Gopala for the kind words and for your support. I am glad you're enjoying the VBA series so far :)

  • @excelisfun
    @excelisfun 6 років тому +10

    Awesome VBA Referencing video!!!! Quote Happy Fun : )

    • @antrikshsharma6990
      @antrikshsharma6990 6 років тому

      ExcelIsFun You should learn VBA as well😁

    • @excelisfun
      @excelisfun 6 років тому +1

      Yes but where could I find a good class!?!?! ; )

    • @LeilaGharani
      @LeilaGharani  6 років тому +1

      Thanks Mike - yes...... not easy to find a good class ;))
      In the past week I've been locked up working on finalizing the course. I haven't had a chance to watch your videos, but I've added them all to my list. Have some catching up to do once I get out of here...

    • @antrikshsharma6990
      @antrikshsharma6990 6 років тому

      ExcelIsFun Try Wise Owl on youtube👍🏻

    • @excelisfun
      @excelisfun 6 років тому +2

      Thank you for reaching out to me!!! But I am sorry, antiksh... I was making a joke... I already know about Wise Owl. I feature the Wise Owl channel and Leila's channel at the excelisfun Channel home page : ) I was making a joke that I should take Leila's class. But really it is no joke - she is so amazing at teaching and marketing and making videos : ) Go Amazing Online Excel Team, including you antiksh!!!

  • @MohAboAbdo
    @MohAboAbdo 4 роки тому

    Thank You So Mutch.

  • @konqueror07
    @konqueror07 4 роки тому +1

    Awesome video. I think this should be the first video to watch for any one beginning to learn macros like me. I've spent hours trying to figure out how to refer cells in different scenarios.
    Can you also mention how to refer to variable ranges? Eg Range from A1 to Ai where "i" is a result of another formula or loop counter etc.
    Thanks for making a video on this topic though.

  • @djibysadji9634
    @djibysadji9634 5 років тому +1

    So clear Leila! Thank you!

  • @nour-eddineoumakhlouf5296
    @nour-eddineoumakhlouf5296 3 роки тому

    Great job, Leila!

  • @aliz3700
    @aliz3700 2 роки тому

    بهترین استادی👏👏👏

  • @Galileo2pi
    @Galileo2pi 3 роки тому

    She is the best

  • @mohieddinedadi317
    @mohieddinedadi317 3 роки тому

    thank you ; its useful

  • @johnborg5419
    @johnborg5419 6 років тому +1

    Thanks Leila. Very Interesting. Some practice and will wait for the next one :)

    • @LeilaGharani
      @LeilaGharani  6 років тому

      You're welcome John. Agree - practice is always good :)

  • @cananpasa5623
    @cananpasa5623 3 роки тому

    Thanks a lot💕💕💕💕💕

  • @alanliu1313
    @alanliu1313 6 років тому

    Very clear and useful!

  • @khalidalisubhanallah2947
    @khalidalisubhanallah2947 6 років тому

    Bundle of Thanks Mam Nice Video

    • @LeilaGharani
      @LeilaGharani  6 років тому

      You're very welcome Khalid. Thank you for your support.

  • @isa.rahban2132
    @isa.rahban2132 3 роки тому

    thank you very much

  • @anilpanda5840
    @anilpanda5840 5 років тому +2

    Thanks a lot, very clear!

  • @shameemnassiree2780
    @shameemnassiree2780 6 років тому

    Thanks ma'am 😊 your videos are quite helpful

    • @LeilaGharani
      @LeilaGharani  6 років тому +1

      You're welcome Sami. Glad to hear that :)

    • @shameemnassiree2780
      @shameemnassiree2780 6 років тому

      Leila Gharani Ma'am do u have videos on data validation, concatenation ?

  • @maryspurplelife2024
    @maryspurplelife2024 5 років тому

    Useful video, Thanks

  • @abhilashc2965
    @abhilashc2965 4 роки тому

    You are Divine. Demi God of Excel

  • @shoaibahmedsagar
    @shoaibahmedsagar 6 років тому +1

    Thanks a lot Leila.

  • @jorge56149
    @jorge56149 4 роки тому

    Thanks!

  • @RaymondJerome
    @RaymondJerome 5 років тому

    thanks, the many ways of getting ranges as part of a row or column is very helpful. all this is similar in openOffice too but they appear to use : and , differently and to also use ;.
    in VBA i never access activesheet or activerange or selection, I actually pass a range or ranges to the code as in the following which i really have no error checking.
    Function rms(ByVal Target As Range) As Double
    'root mean squared. quadratic mean
    Dim Cell As Range
    Dim summand As Double
    Dim tot As Integer
    tot = 0
    summand = 0#
    For Each Cell In Target.Cells
    If IsNumeric(Cell) Then
    tot = tot + 1
    summand = summand + Cell ^ 2
    End If
    Next Cell
    rms = Math.Sqr(summand / tot)
    End Function

    • @RaymondJerome
      @RaymondJerome 5 років тому

      i also use parallel ranges, either rows or columns 1 wide, but have to not use for each

  • @nancyd.5990
    @nancyd.5990 5 років тому +2

    U r the best

  • @satishpatel6530
    @satishpatel6530 4 роки тому

    Nice video

  • @khalidalisawi8037
    @khalidalisawi8037 Рік тому

    you are great, really it interesting video

    • @LeilaGharani
      @LeilaGharani  Рік тому

      Thank you! 😃

    • @khalidalisawi8037
      @khalidalisawi8037 Рік тому

      @@LeilaGharani

    • @khalidalisawi8037
      @khalidalisawi8037 Рік тому

      @@LeilaGharani dear I follow most your videos really it was very interesting and my level is progressing but can you guide me to advanced book in vba

  • @mohitdhanwani5540
    @mohitdhanwani5540 6 років тому

    Thanks for the video ma'am.

  • @annpurnakumari7218
    @annpurnakumari7218 5 років тому +1

    Really awesome. Thanks.

  • @johnkoay8097
    @johnkoay8097 2 роки тому

    you are good.

  • @DakshaNY
    @DakshaNY 4 роки тому

    its good really

  • @moisestatis5418
    @moisestatis5418 Рік тому

    I like how you teach. In fact, I'm enrolled in your Power Query Course. I'd assumed that you also have a Excel VBA course right? I'd like to learn macros.

  • @walek2001
    @walek2001 5 років тому +2

    thank you!

  • @lpanades
    @lpanades 4 роки тому

    Thanks

  • @Donnie64inPa
    @Donnie64inPa 2 роки тому +1

    Just figured out my error: I named my module Cells which started this whole mess! (I left my question for anyone else's benefit)>>>>Thanks for the work you put into this video Leila, quick question: When I tried to use your second example: cells(1,1)="1st" it gave me an error: Compile error: Expected variable or procedure, not module. It's like vba isnt recognizing that expression because it's not even suggesting anything when I type the "cells(" part....... Thanks for any help.

  • @keishrich
    @keishrich 6 років тому

    I wish more women would use/support your channel. 😊

    • @LeilaGharani
      @LeilaGharani  6 років тому +1

      Me too! We need more women here!

  • @tariquejameel9068
    @tariquejameel9068 3 роки тому

    Can you make video on cutting length optimisation

  • @vinodmusuyuni3558
    @vinodmusuyuni3558 6 років тому

    Superb videos

    • @LeilaGharani
      @LeilaGharani  6 років тому

      Thank you Vinod! Glad you like the videos.

  • @AliHasan-lr4xj
    @AliHasan-lr4xj 5 років тому +1

    Very informative , but I have a request if you can show us how to merge cells than contains same value with option for Excel user to select the cells range as an input on dailog box
    Thanks

  • @hosseinhosseinpoor4845
    @hosseinhosseinpoor4845 3 роки тому

    thanks thanks thanks

  • @21121990jay
    @21121990jay 4 роки тому +2

    Hi @Leila , how would you select two ranges and select them together ?
    E.g. Header should be fixed Range (First Range) and second range would be from active cell range.