How to Declare (Dim) and Set VBA Variables (use data types correctly)

How to Declare (Dim) and Set VBA Variables (use data types correctly)

Leila Gharani

6 лет назад

174,062 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Progress marini
Progress marini - 12.12.2022 17:18

Can I use the set statement at the module level? I have declared many variables as sheets and don't want to have to set them in every sub() I have in the same module. thank you

Ответить
Kunja Gupta
Kunja Gupta - 14.09.2022 18:54

Hi looking code that help me to add cell data while we use send email cose

Ответить
Meni Porat
Meni Porat - 08.06.2022 22:33

Hi Leila, a minor correction:
The largest positive number that the INTEGER data type can hold is not: 32768 but: 32767.
Thank you for your excellent videos 🙂

Ответить
golu bhai
golu bhai - 24.05.2022 13:37

set is basically a setter and getter concept from oo programming I guess

Ответить
AE V
AE V - 16.02.2022 19:08

10/10

Ответить
MIM GURU
MIM GURU - 29.12.2021 20:54

Good👍

Ответить
工藤一郎
工藤一郎 - 24.10.2021 14:27

You have to be careful when you use a long long variable.

Ответить
Felipe Monteagudo
Felipe Monteagudo - 21.10.2021 16:45

Useful and clear as always, I love <3 your videos Leila!

Ответить
roebroe
roebroe - 26.08.2021 07:29

Awesome.

Ответить
The life log
The life log - 04.08.2021 11:47

Hi madam can you please do videos on averageif using vba in which user changes data every time it automatically updates.

Ответить
Nahed A. Ikhtier
Nahed A. Ikhtier - 07.07.2021 00:47

Your every video is very helpful 😊😊

Ответить
Latiffesa Esa
Latiffesa Esa - 09.06.2021 15:18

You are beautiful

Ответить
Tiger Tiger
Tiger Tiger - 15.02.2021 12:19

What will happen if I used integer data type for a data with a value of 32,769 or more?

Ответить
hossein hosseinpoor
hossein hosseinpoor - 06.02.2021 14:54

thanks thanks thanks

Ответить
Eduardo OC
Eduardo OC - 06.01.2021 11:16

I appreciate it thank you very much

Ответить
Tan Wen
Tan Wen - 15.12.2020 11:32

Love your videos, they are clear and easy to understand. :D

Ответить
dd doda
dd doda - 25.11.2020 05:07

oh! Just the info I was looking for. Now my macro works! Thanks.

Ответить
Amit Kumar
Amit Kumar - 18.11.2020 17:21

Thankyou

Ответить
Melki Hassa
Melki Hassa - 25.09.2020 00:15

Thank you, very helpful

Ответить
Poultry Land
Poultry Land - 12.09.2020 20:06

The only problem with it is that text you are typing fades away while you are typing, please fix it, your lectures are superb

Ответить
RAMBO
RAMBO - 12.06.2020 14:49

useless shit

Ответить
Pedro Câmara
Pedro Câmara - 26.05.2020 03:31

Your tutorials are very good. thank you.

Ответить
Sohail Moosa
Sohail Moosa - 20.05.2020 02:31

Hi Leila,

I'm currently your student using Udemy Business. And I feel I'm lucky to get enrolled with an excellent teacher. I couldn't figure out how to send you a query in Udemy and hence ended up searching for you here and would ask one. I have currently completed lecture 35 that speaks abt declaring variables. I'm unable to understand why do we beed variables? Is it necessary to have variables? What are variables? And can't I do without them in vba. I am a novice and have seen many codes and most of them have variables. But I always had these questions in my mind. I have googled alot, but nothing has solved this question yet.

Please reply.

Ответить
Firdaus Basheer
Firdaus Basheer - 19.04.2020 17:17

Amazing tutorials

Ответить
Dhruvil Barbhaya
Dhruvil Barbhaya - 17.04.2020 13:11

During such lock down, watching such easy explanation of tough topic is awesome..
U r up to the point and so clear, and same time so easy......

Ответить
amc
amc - 18.03.2020 06:48

Intriguing rabbit hole I have stumbled upon.

Ответить
Tanner Tucker
Tanner Tucker - 10.03.2020 06:41

Thank you. Your vba and excel courses are excellent.

Ответить
Алексей Фоксов
Алексей Фоксов - 07.03.2020 16:14

Thank you

Ответить
mdcs1992
mdcs1992 - 10.01.2020 02:05

I have multiple disabilities and health problems. In my sixties now and lost my job because of them......but a love of Excel makes me want to learn vba. I recorded a macro that "Cleared Content" from multiple non contiguous Ranges. I went into gab to run it but kept getting an error at lines of code starting with "Union Range." Can't understand it. Is it simple to rectify? Your channel is IMHO the best on You Tube for Excel. Well explained. Great examples and explanations. Superb. Thank you very much

Ответить
Jokki Ossaka
Jokki Ossaka - 07.11.2019 18:03

Thank you very much Leila!

Ответить
Steven Nye
Steven Nye - 24.10.2019 23:21

good review!

Ответить
Amrutha Bathini
Amrutha Bathini - 20.08.2019 17:45

Hi LEILA,

Your video is very helpful and it is very clear to understand.
Can you please help me with the following scenario:
1) I have a workbook of sheet1 with two columns and a few rows.
2) Applied filter for sheet1 data
3) I have duplicated the sheet1 in the same workbook and renamed it as "Test"
4) Deleted the duplicates in sheet2
5) Now, I need your help in copying a cell value(the data is dynamic) of sheet2 and paste it in the filtered column of sheet1 so that I can write the comments beside the two columns of sheet1.

**NOTE: DATA IS DYNAMIC

The columns are as below:

SHEET1:

COLUMN-1 COLUMN-2
abc apple
abc windows
123 android
abc os
b phone
123 android
abc blackberry
abc apple
b nokia
abc lenovo

SHEET2:

COLUMN-1 COLUMN-2
abc apple
123 android
b phone

I need the final result like this in SHEET1

COLUMN-1 COLUMN-2 COMMENT
abc apple
abc windows same as apple
123 android
abc os same as apple
b phone
123 android same as android
abc blackberry same as windows
abc apple same as apple
b nokia same as phone
abc lenovo same as apple

IT WOULD BE REALLY HELPFUL IF YOU CAN GUIDE ME ASAP.

Ответить
Roberto Martins
Roberto Martins - 29.07.2019 01:53

Thanks.

Ответить
Simon Phoenix
Simon Phoenix - 20.07.2019 18:19

You are amazing...

Ответить
Md. Mahbub Rahman
Md. Mahbub Rahman - 05.07.2019 21:26

Very Informative & useful. Thank you for uploading & expecting more.

Ответить
mitesh kumar
mitesh kumar - 23.06.2019 14:37

So could you please let us know the usage of "new" keyword, as far as i understood "new" keyword is used to instantiate object variables. Thanks in advance !

Ответить
Mohammad Almomani
Mohammad Almomani - 11.06.2019 13:55

Hello
I am trying to find an vba code to copy and paste every  range of rows like(A1:C19).copy and paste in word file as image then copy from (A20:C39) and paste in the same word file and so on for the rest of the table in excel. they have told me that I need to use the looping in excel but I don't know exactly how to do it …. please help if you can

Ответить
jashan Brar
jashan Brar - 19.05.2019 17:11

Very good ese hi ielts ke bare mai b batayo

Ответить
Thanos Litsakos
Thanos Litsakos - 15.05.2019 21:11

LET used in old BASIC programming language. I remembered it first time i saw Spectrum's Sinclair Basic

Ответить
D Schulz
D Schulz - 09.05.2019 01:00

This helped explain a bunch for me. Usually videos don't help much when it comes to coding but this was actually very helpful. Thank you!

Ответить
Tung Chan HSIEH
Tung Chan HSIEH - 17.04.2019 12:10

Thanks Leila, helps me a lot!

Ответить
Indian Pigeon
Indian Pigeon - 02.02.2019 07:55

Love u lots

Ответить
Teymur Rashidli
Teymur Rashidli - 29.01.2019 20:30

İn VBA round(10.25,1)=10.2 but in normal excel round(10.25,1)=10.3 I need calculate exactly in excel VBA. How can I round in VBA exactly? I need round(10.25,1)=10.3 in VBA

Ответить
nabil sn
nabil sn - 11.11.2018 14:41

Cool thx

Ответить
Vivek Phadke
Vivek Phadke - 29.07.2018 14:03

I can easily remember what you teach. Thanks a lot.

Ответить
Hamidur Rahman Pro
Hamidur Rahman Pro - 28.07.2018 07:04

Helpful

Ответить
Hamidur Rahman Pro
Hamidur Rahman Pro - 28.07.2018 06:59

Helpful :)

Ответить
kumarsandy2008
kumarsandy2008 - 16.07.2018 09:03

hi , i am a beginner to vba macros, and want to get skilled in this field, i want to learn all the looping process and array......and charts with vba....could you please help....

Ответить