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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,213,527
Messages
6,114,150
Members
448,552
Latest member
WORKINGWITHNOLEADER

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