Using Offset with Ranges

syoun02

New Member
Joined
Apr 18, 2002
Messages
23
I am still new to learning VBA. I want to be able to copy a cell, move it over a certain number of rows/colums (via the offset function) and then paste the cell into 3 different consecutive columns. How do I write the code- do I integrate the range function into the offset function?

Thanks!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
I reckon you're well on the way there.
For example, to copy the contents of Cell A10 to Cells B11 through F11...

Range("A10").Select
Selection.Copy

Range(ActiveCell.Offset(1, 1), ActiveCell.Offset(1, 5)).Select
ActiveSheet.Paste

Rgds
AJ
 
Upvote 0
Play with something like this:

Code:
Sub cpy()
ActiveCell.Copy ActiveCell.Offset(1, 4).Resize(, 3)
End Sub

Like offset, resize has two paramters, rows & columns. You can change activecell to a range (e.g., [a1].Copy [a1].Offset(1, 4).Resize(, 3))

Hope this helps.

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
This message was edited by NateO on 2002-05-02 08:24
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,185
Members
448,872
Latest member
lcaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top