Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default range: question

hi

why doesn't that piece of code work:
table1.range("B19","C19") = table1.range("A2","B2")
or
table1.range("B19:C19") = table1.range("A2:B2")

both do not work. I want to copy the content from table5 at A2:B2 to table1
at B19:C19

when I only select one cell, like this: range("A2"), it works great.

thanks for your help
Simon


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default range: question

Simon,

Try this

Range("B19:C19").Value = Range("A2:B2").Value

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Simon Sunke" wrote in message
...
hi

why doesn't that piece of code work:
table1.range("B19","C19") = table1.range("A2","B2")
or
table1.range("B19:C19") = table1.range("A2:B2")

both do not work. I want to copy the content from table5 at A2:B2 to

table1
at B19:C19

when I only select one cell, like this: range("A2"), it works great.

thanks for your help
Simon




  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default range: question

I didn't test your code to figure out why it doesn't work,
but here's some code that will work (adjust accordingly):
-------- Begin Code --------
Dim rng As Range

Set rng = ActiveSheet.Range("A2:B2")
rng.Copy ThisWorkbook.Worksheets("Sheet2").Range("B19:C19")
Set rng = Nothing
-------- End Code --------

This code assumes that the worksheet with the A2:B2 range
is the active one at the time of its execution.


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
Range Question Peter[_8_] Excel Discussion (Misc queries) 3 December 11th 07 02:37 AM
Range Question N.F[_2_] Excel Discussion (Misc queries) 5 July 28th 07 01:05 AM
range question Simon Sunke Excel Programming 0 February 23rd 04 02:41 PM
Range Question Ray Batig Excel Programming 4 January 31st 04 05:01 AM
Range.Formula and Range question using Excel Automation [email protected] Excel Programming 0 September 19th 03 04:53 AM


All times are GMT +1. The time now is 02:17 AM.

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"