Easy Question: Cell Value

R

Robert_DubYa

I've programmed vba in access before but not Excel. I simply want to create
a msgbox that shows the value of a cell.

Example

sheet1:

A B C
1 Value No No
2 No No No

code:

msgbox A1

does not return the referenced value. Just blank (triggering off a command
button).

Sorry for such a nobb question....But thanks!

Robert
 
C

Cliff

I've programmed vba in access before but not Excel.  I simply want to create
a msgbox that shows the value of a cell.

Example

sheet1:

          A          B          C
1     Value       No        No
2        No        No        No

code:

msgbox A1

does not return the referenced value.  Just blank (triggering off a command
button).

Sorry for such a nobb question....But thanks!

Robert

MsgBox Sheets("Sheet1").Range("A1")
 
D

Dave Peterson

msgbox activeworkbook.worksheets("sheet99").range("a1").value
or
msgbox activesheet.range("x99").text 'if it's formatted nicely.
 
J

john

If the cell you want the msgbox to display is the activecell then maybe:

msgbox activecell.value
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top