Excel Macro VBA Tip 11 - Assign Excel Cell Contents to Variables in Excel Macros

preview_player
Показать описание

Learn how to assign a variable in an Excel macro to the value of a cell's contents in the spreadsheet. This tutorial will also teach you how to assign variables in macros as a string or an integer. The goal is to show you how to pull values from spreadsheets into macros in order to use those values when performing calculations or operations within the macro. You will also learn how to output the value of a variable into a cell within the Excel spreadsheet.


Have a great day!
Рекомендации по теме
Комментарии
Автор

Thank you brother, works to this day.

growth
Автор

Thank you for your video i can't wait to try this out

wreckerray
Автор

For which purpose this VBA code use? Please explain.

anandsharma
Автор

Thanks for the video.
How can we point to a particular worksheet in case we have multiple worksheets .
In the video you only have one worksheet.

rustagialok
Автор

what if I have multiple worksheets, how do i reference a sheet and cell? thanks

scottloseke
Автор

What if I want values from random cells? Like any value from A2 to A17?

Potew
Автор

I use the same way to define a variable but it gives me "application defined or object defined error". why? I'm using excel 2010.

pj
Автор

Hi, nice tut. I have a problem though. I am a student trying to do an exel work. I have a cell with a value let say 10. In another cell, I want to manually enter a value and it will be added to the value of the first cell. Example : A1 has is 10. If I enter 10 in B1, 1 will be added to A1. A1 becomes 20. If I then enter 23 in B1, A1 becomes 43. Which means it adds 23 from B1 to the 20 in A1. So, for everytime I enter a value in B1, A1 increases by that numer.
Any help plz
Tnx

Fecobee
Автор

got it: colno = Sheets("Sheet1").Range("A1")

scottloseke
Автор

What is String
And what is Integer
And what is the uses of both
And where we can use them
And where we can't..?

kamrulzoha
Автор

Why not you speak in Hindi
I wanna learn but my English is not so good

And we have some good Hindi VBA Teacher on You tube
But they do only what they want not go with serial
And also they don't explain as you.

kamrulzoha
visit shbcf.ru