Copying a range to clipboard
Thanks Tom,
I'll have a play around with it and get back to you. I
can't see what is wrong but it certainly generates the
error message on mine. I'll copy my formulas and code
relating only to this section to an empty sheet and see
what happens.
Regards,
Richard
-----Original Message-----
I can't reproduce it - even on an empty spreadsheet:
set rng = Range(Range("T9"),Range("T111").End(xlup))
? rng.Address
$T$5:$T$9
--
Regards,
Tom Ogilvy
Richard wrote in message
...
Hello Tom,
Just tried the code but a bit of a problem. Crashes at
line commencing "set rng". Error Msg 1004, Application-
defined or Object-defined error.
Range P9:P100 is anti-aliased and Range T9:T100 is
highlighted when it crashes.
Any clues?
Thanks,
Richard
-----Original Message-----
Application.ScreenUpdating = False
Application.Goto Reference:="R9C16:R110C16" 'P9
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Application.Goto Reference:="R9C20:R110C20" 'T9
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
True, Transpose:=False
set rng = Range(Range("T9"),Range("T111").End(xlup))
rng.copy
Range("B4").Select
Application.ScreenUpdating = True
End Sub
--
Regards,
Tom Ogilvy
"Richard" wrote in message
...
Sub Send2Application()
Could someone lend a hand here please.
I'm copying the range P9:P110 to T9
The range will include some cells with nothing in
them
that is:- no formulas or text.
Then I want to extract from T9:T110 JUST the cells
that
have data. (It will be text data)
These cells are then copied to the clipboard for
pasting
into another application.
I keep getting many blank cells at the bottom which I
don't want.
How do I just get the cells with text in them.
Thanks,
Richard
This is my code
ActiveSheet.Unprotect
Application.ScreenUpdating = False
Application.Goto
Reference:="R9C16:R110C16" 'P9
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Application.Goto
Reference:="R9C20:R110C20" 'T9
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
True, Transpose:=False
Selection.Copy
Range("B4").Select
Application.ScreenUpdating = True
End Sub
.
.
|