Thread: Range problem
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Range problem

Mark,

A couple of thoughts.

If you select a range, then the sheet that the range is on has to be active,
as the selection has a visual aspect, the screen is re-painted with the
selected cells, so hence it must be the active window for this re-paint to
happen.

Help does not say that Range(cells(row,column)) is valid. In the part on
Range and Cells, it states the form Range(cell1,cell2), in other words you
specify the start and end position of the range. Thus, with your example
Range(cells(row,column),(cells(row,column)) will work, but that is perverse
when you can simply put Cells(row,column), which is also a range.

--

HTH

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

"Mark" wrote in message
...
Thanks Bob!

It worked!! I am still puzzled that Range(cell(row,column)) part of the

coed
does not work. After all the doc clearly says it should work. But thats

just
acedemia anyway, your solution is more smooth. Thanks again.

Mark


"Bob Phillips" wrote in message
...
Mark,

Why not put it all together

Worksheets("TABLES").Cells(row, column).Copy _
Destination:=Worksheets("hidden").Cells(rowCounter , 1)


--

HTH

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

"Mark" wrote in message
...
Hi NG

I have a problem with ranges

i want to do a copy operation.

Worksheets("TABLES").Activate
Cells(row, column).Select
Selection = Worksheets("TABLES").Cells(row, column)

Worksheets("hidden").Activate
Cells(rowCounter, 1).Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

SkipBlanks
_
:=False, Transpose:=False


This works but have the anoying side effect that the worksheets are
activated, which causes flickering. So i tried this instead

Worksheets("TABLES").Cells(row, column).Select
Selection.Copy Destination:=Worksheets("hidden").Cells(rowCounter , 1)

Works fine!! there is no flickering, but now for some reason it only

works
if the worksheet TABLES is active before i do the operation.

Basically i want to do something like this

Worksheets("TABLES").Range(Cells(row, column)).Copy _
Destination:=Worksheets("hidden").Cells(rowCounter , 1)

But now i get this strange run time error 1004
If i do something like

Worksheets("TABLES").Range("a4").Copy _
Destination:=Worksheets("hidden").Cells(rowCounter , 1)

Then it works without TABLES being active before i do the operation.

STRANGE

the documentation clearly states that i can do a Range(Cell(x,y)). I

DONT
GET IT


Regards Mark