retrieving the contents of a cell using visual basic macro


Posted by Jason Masters on January 29, 2002 9:34 AM

Hello,

I am trying to create a macro where the macro would go to a particular cell, retrieve the number and save it as a variable for future manipulation.

So if cell "B1" was the number 49, the macro would retrieve 49 from "B1" and save it as variable "x".



Posted by faster on January 29, 2002 9:36 AM

Sub GetX()
Dim X
X = Range("B1").Value
'message box can be deleted
MsgBox X
End Sub