Excel VBA Activate vs Select vs Selection vs ActiveCell
HTML-код
- Опубликовано: 23 июл 2024
- Excel Macro tutorial that explains the difference between Activate and Select as well as Selection and ActiveCell - these are often-confused yet important things to understand in VBA and Macros.
Excel File: www.teachexcel.com/excel-tuto...
Excel Forum: www.teachexcel.com/talk/micro...
This tutorial will cover many examples of when and how to highlight cells in Excel using Select and Activate and then explain when to use each one. As well, this tutorial will cover the differences between Selection and ActiveCell and then tell you when and how to use each one.
The concepts in this tutorial are often mixed-up or confused with one another and this tutorial serves the purpose of untangling the mess and trying to explain everything to you in a simple and easy-to-understand way.
As well as containing many examples, the macros included in this tutorial are heavily commented so that you can use them as a reference if you get stuck in the future.
This tutorial is part of a larger online course that I will be making for TeachExcel, so stay tuned for updates.)
I hope you enjoy this tutorial! Stay safe out there!
TeachExcel.com
#excel #tutorial #onlinecourse
I've just started trying to make this part of my skillset and let me just say I have never seen someone explain it so clearly. thanks for uploading this vid!
Excellent explanation. Thank you :)
Thank you! Very good explanation.
Fantastic!!!
Helpfull e clear explanation!!!
Thanks!!! 👏👏👏👏👏
Nice informative video ..Thank You Sir
Cool Tutorial..Really Well Explained Thank You Sir :)
Thanks! Glad you like it! Sometimes I end up blathering too much and forgetting if I'm helpful or not haha
good job!
Thanks.. important topic. I see a lot of code where the author has bounced back and forth between the methods.. dangerous! Thanks for the videos. Thumbs up and stay safe out there!
That is so true! Or, when they start with the Macro recorder and end up selecting every darn cell before they do something with it hah. Thanks! I'm treating everyone like they are a zombie haha - you stay safe yourself!
nice msgbox exercise but how do I get the USER Selected range into my macro dimensioned MyRange.
You will use arrays and then either a For Each loop or Nested For Next loop (better option usually) to go through the range and do what you want with it. Arrays are quite complex but very useful, if you want to upload a sample file or just add more details, you can ask in our forum on TeachExcel.com and get help with vba code samples.
So I've been searching for a solution to a problem I have. My macro does some copying and pasting using ActiveCell.Offset. Because the cell I'm moving to and from isn't always the same. Now what I want to do is make a range selection FROM the active cell. So it's like a combination of a range selection with an activecell offset. The selection will always be from the active cell and to the right 3 cells. But if the active cell changes I can't use range because it needs to know the cell. I tried Range.Offset but that didn't work.
Same problem here. Do you already have the solution?