ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Offsetting Cells (https://www.excelbanter.com/excel-programming/331640-offsetting-cells.html)

PGalla06

Offsetting Cells
 

What I'm trying to do is copy a range of cells and paste it through out
my worksheet. For instance, suppose I select and copy A1:C4, how would
then select the A5:C8 using VBA in order to paste the copied cells? Can
I use some variation of the Offset command?


--
PGalla06
------------------------------------------------------------------------
PGalla06's Profile: http://www.excelforum.com/member.php...o&userid=24260
View this thread: http://www.excelforum.com/showthread...hreadid=378690


Jim Thomlinson[_4_]

Offsetting Cells
 
You can try this... Copies a range and pastes it four columns to the left...

Public Sub CopyRange()
Dim rng As Range

Set rng = ActiveSheet.Range("A1", "C4")

rng.Copy rng.Offset(0, 4)
End Sub
--
HTH...

Jim Thomlinson


"PGalla06" wrote:


What I'm trying to do is copy a range of cells and paste it through out
my worksheet. For instance, suppose I select and copy A1:C4, how would
then select the A5:C8 using VBA in order to paste the copied cells? Can
I use some variation of the Offset command?


--
PGalla06
------------------------------------------------------------------------
PGalla06's Profile: http://www.excelforum.com/member.php...o&userid=24260
View this thread: http://www.excelforum.com/showthread...hreadid=378690




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

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