Using VB to type something into a cell

P

petros89

Hi, I'm using VB to produce a macro which types the number "1" into
cell..

So far I have:

Sub deleteme()
'
' deleteme Macro
' Macro recorded 29-11-2005 by Petros Poullaides
'

'
Range("C3").Select
motherboard = Range("C3")
Sheets("Parts").Range("C3") = motherboard
End Sub

but it just deletes the value in cell C3....how do i make it type "1
in cell C3?

Please help as it is for my schoolwork..
Thanks in advance.

Petro
 
N

Norman Jones

Hi Petros,

Your question is unclear.

What is 'motherboard'.

To enter the value 1 in C3, try:

Range("C3").value = 1


If this is not what you intend, then please supply additional information.
 
J

Jef Gorbach

You just about got it, but need to set the motherboard variable to the Value
of Range("C3"). BTW, in -most- cases, .Select an object to work with it is
unneccessary and merely slows your code down.

try this:
Sub deleteme()
' Macro recorded 29-11-2005 by Petros Poullaides
motherboard = Range("C3").value
Sheets("Parts").Range("C3") = motherboard
End Sub

which does the same as: Sheets("Parts").Range("C3") =Range("C3").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