ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy and paste (https://www.excelbanter.com/excel-programming/352891-copy-paste.html)

PBANKS

Copy and paste
 

I am having trouble, I want to copy a range after I select it. The rang
changes so I have to figure out where it ends then select it, copy i
and then paste it. I can find the end, but the rest is over my head.
have no training in VB, but I fiddle with it to help at work.

Sub copyctob()
ActiveSheet.Activate
Dim myrange As Range

Range("c4").Select
Do While ActiveCell "0"
If ActiveCell "0" Then
ActiveCell.Offset(1, 0).Activate
Else
ActiveCell.Select
End If
Loop
ActiveCell.Offset(-1, 0).Activate
myrange = ActiveCell
ActiveCell.Select


Range("c4:myrange").Select



End Su

--
PBANK
-----------------------------------------------------------------------
PBANKS's Profile: http://www.excelforum.com/member.php...fo&userid=3137
View this thread: http://www.excelforum.com/showthread.php?threadid=51062


KingMartin

Copy and paste
 
If I read you corectly, you want to copy C4:C lastrow to somewhere...

With Sheet1
.Range("C4:C" & .[c65536].End(3).row).copy Destination:= Sheet2.Range("A1")
End with

will copy the desired range to sheet2...

Martin


PBANKS[_2_]

Copy and paste
 

I have an error "Object Required"


--
PBANKS
------------------------------------------------------------------------
PBANKS's Profile: http://www.excelforum.com/member.php...o&userid=31370
View this thread: http://www.excelforum.com/showthread...hreadid=510620



All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com