![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 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! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
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 |
|
|
|
|
|
#3 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Play with something like this:
Code:
Sub cpy() ActiveCell.Copy ActiveCell.Offset(1, 4).Resize(, 3) End Sub Hope this helps. _________________ Cheers, NateO [ This Message was edited by: NateO on 2002-05-02 08:24 ] |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
Cool!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|