how do i type something in a cell using vba?

G

Giorgio

in a vba code, i use worksheets.()value... to attribute a value to a
variable. is that correct? and how do i actually print something a variable
contains, like eg sum=123 and i want to print 123 in cell A3 in worksheet Raw
of workbook 1.xls. funnily, i cannot get this answer in simple help of
office. a rookie in vba, i must admit! thanks
 
P

Per Jessen

in a vba code, i use worksheets.()value... to attribute a value to a
variable. is that correct? and how do i actually print something a variable
contains, like eg sum=123 and i want to print 123 in cell A3 in worksheet Raw
of workbook 1.xls. funnily, i cannot get this answer in simple help of
office. a rookie in vba, i must admit! thanks

Hi

Sum = 123
Worksheets("Raw").Range("A3") = Sum

Reards,
Per
 
S

salgud

in a vba code, i use worksheets.()value... to attribute a value to a
variable. is that correct? and how do i actually print something a variable
contains, like eg sum=123 and i want to print 123 in cell A3 in worksheet Raw
of workbook 1.xls. funnily, i cannot get this answer in simple help of
office. a rookie in vba, i must admit! thanks

simplest way is something like:
activesheet.range.("A3") = sum
Substitute the real spreadsheet name for "activesheet".
There are lot of other ways to do this, depending on the context.
Hope this helps in your world.
 

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