Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using VB to type something into a cell


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

--
petros8
-----------------------------------------------------------------------
petros89's Profile: http://www.excelforum.com/member.php...fo&userid=2464
View this thread: http://www.excelforum.com/showthread.php?threadid=48904

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Using VB to type something into a cell

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.

---
Regards,
Norman



"petros89" wrote in
message ...

Hi, I'm using VB to produce a macro which types the number "1" into a
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.

Petros


--
petros89
------------------------------------------------------------------------
petros89's Profile:
http://www.excelforum.com/member.php...o&userid=24645
View this thread: http://www.excelforum.com/showthread...hreadid=489047



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Using VB to type something into a cell

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

"petros89" wrote in
message ...

Hi, I'm using VB to produce a macro which types the number "1" into a
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.

Petros


--
petros89
------------------------------------------------------------------------
petros89's Profile:

http://www.excelforum.com/member.php...o&userid=24645
View this thread: http://www.excelforum.com/showthread...hreadid=489047



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Look up cell content by type and copy to different cell Sam Huleis Excel Worksheet Functions 1 November 17th 08 11:12 PM
Type 3 digits in one cell then automatically move to next cell. mulligbo Excel Discussion (Misc queries) 4 October 27th 06 11:51 PM
type MI in cell, have Michigan show in adjacent cell shark Excel Discussion (Misc queries) 2 October 20th 06 07:57 AM
Change Cell Value Across whole WorkSheet/ Workbook if cell type is currency Shashi Bhosale Excel Programming 1 October 11th 04 03:20 PM
Type into one cell and automatically clear contents in another cell Bo Excel Programming 4 September 29th 03 06:04 PM


All times are GMT +1. The time now is 11:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"