range: question

  • Thread starter Thread starter Simon Sunke
  • Start date Start date
S

Simon Sunke

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
 
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)
 
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.
 
Back
Top