Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Copy a value to a range of cells

Hi,

In my VBA program, I would like to put the value of a
variable to a range of cells. e.g. put the same value
from cells A1 to A10. How to do it? I tried to use Range
selection method but it doesn't work.
Anyone knows? Thanks a lot.

Terence
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Copy a value to a range of cells

Try this Terence

Sub test()
Yourstring = "Terence"
Range("a1:a10").Value = Yourstring
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Terence" wrote in message ...
Hi,

In my VBA program, I would like to put the value of a
variable to a range of cells. e.g. put the same value
from cells A1 to A10. How to do it? I tried to use Range
selection method but it doesn't work.
Anyone knows? Thanks a lot.

Terence



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Copy a value to a range of cells

Thanks a lot!

-----Original Message-----
Try this Terence

Sub test()
Yourstring = "Terence"
Range("a1:a10").Value = Yourstring
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Terence" wrote in message

...
Hi,

In my VBA program, I would like to put the value of a
variable to a range of cells. e.g. put the same value
from cells A1 to A10. How to do it? I tried to use Range
selection method but it doesn't work.
Anyone knows? Thanks a lot.

Terence



.

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
Copy a range of cells repeatedly Exceller Excel Worksheet Functions 2 August 1st 08 08:09 PM
Copy certain range of cells Wesleybrack Excel Discussion (Misc queries) 1 March 2nd 06 04:23 PM
How to use macros to copy a range of cells which can exclude some cells which I didn't want to be copied? excelnovice Excel Worksheet Functions 2 September 25th 05 12:38 AM
Copy Range of Cells in Same Row Moe Excel Discussion (Misc queries) 1 August 4th 05 06:47 PM
Copy cells into range of cells until cell change mdeanda Excel Worksheet Functions 1 April 22nd 05 08:41 PM


All times are GMT +1. The time now is 02:45 PM.

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

About Us

"It's about Microsoft Excel"