Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Populating a Range by Code

When a user selects an item from a list box I would like
it to go and select a range of from a sheet and
insert it in to another sheet, I tried doing this

Sheets("Book vs Plan").Range("d50:o50") = Sheets
("plan").Range("d4:o4")

but that failed, no error messages but no data either.

Can someone help me with the correct syntax

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Populating a Range by Code

Hi Nigel

Only add .value and it is working

Sub test()
Sheets("Book vs Plan").Range("d50:o50").Value = _
Sheets("plan").Range("d4:o4").Value
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Nigel Bennett" wrote in message ...
When a user selects an item from a list box I would like
it to go and select a range of from a sheet and
insert it in to another sheet, I tried doing this

Sheets("Book vs Plan").Range("d50:o50") = Sheets
("plan").Range("d4:o4")

but that failed, no error messages but no data either.

Can someone help me with the correct syntax

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Populating a Range by Code

Further to Ron...

The default property of the range object is .Value and so Excel almost
always uses it when it's omitted as you have done. But not always. Fwiw, I
never assume the default will work; I always specify what I want (.Value in
this case.)

--
Jim Rech
Excel MVP

"Nigel Bennett" wrote in message
...
| When a user selects an item from a list box I would like
| it to go and select a range of from a sheet and
| insert it in to another sheet, I tried doing this
|
| Sheets("Book vs Plan").Range("d50:o50") = Sheets
| ("plan").Range("d4:o4")
|
| but that failed, no error messages but no data either.
|
| Can someone help me with the correct syntax
|
| Thanks
|


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
Populating a range from tab b into tab a Xman Excel Worksheet Functions 1 February 24th 10 01:42 PM
Populating a cell based on a range of values akkrug New Users to Excel 2 June 20th 08 03:09 PM
Populating a Range Dependant on a List [email protected] Excel Worksheet Functions 9 November 5th 07 09:24 AM
Populating a range Nigel Bennett Excel Programming 1 July 1st 04 07:27 PM
Populating a Named Range... debartsa Excel Programming 2 February 5th 04 03:04 PM


All times are GMT +1. The time now is 09:23 AM.

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"