getting cell value

minsoo

New Member
Joined
Mar 31, 2002
Messages
3
Hi, Im a new to writing excel macros and Im running into a problem that I'm sure has an easy solution. I would like to get the value of a cell, (.Cells.Value(2,2)) and store it into a variable within my module. x=.Cells.Value(2,2) However, I need the variable to be an integer or number, not a string or variant. This is so that I can take the value from the cell and manipulate it as a number. (i.e., x = x + 1)If anyone could give me a little guidance on this, I would be most appreciative. Thanks.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi
Just a little addition to Al Chara.
I do not know what your number is, but assigning a variable dimmed as an integer will only accept whole numbers from -32,768 to 32,767.
If you run into any problems, search for Data Types in VBA help.
Have a Nice Day!
Tom
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,049
Latest member
THMarana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top