Solved

Excel VBA - copy cell to Dynamic Ragge

Posted on 2012-03-18
8
471 Views
Last Modified: 2012-03-25
Hi Experts,

I would like to copy the current cell (highted range) to the cells next (next 10 cell on the right) to it.

Now I'm doing it on an uneffective way :

Set CurrCell = ActiveCell
    Application.ScreenUpdating = False
    Selection.Copy
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, 1).Select
    ActiveSheet.Paste

Can you help me to make it more simple

thanks
0
Comment
Question by:desmondwkng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 250 total points
ID: 37736220
Activecell.copy range(activecell.offset(0,1),activecell.offset(0,10))
0
 

Author Closing Comment

by:desmondwkng
ID: 37736449
thanks
0
 

Author Comment

by:desmondwkng
ID: 37740115
Dear ssaqibh

What if I would like to copy of range of cell, say 7 vertical cell to the next 10 horizontial cell
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37741040
Something like

Range(ActiveCell, ActiveCell.Offset(7, 0)).Copy Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 10))
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37741041
Or simply

ActiveCell.Resize(7, 1).Copy Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 10))
0
 

Author Comment

by:desmondwkng
ID: 37746306
ssaqibh

in my orignial marco, I can hightligt the copy area(variable range also) by using the cursor, then I can use the marco to copy across the row. But here I have to define the ActiveCell Size(or range) first.  
Is there a way that I can use the cursor to highlight the range and copy across

thanks
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37749212
Try

Selection.Copy Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 10))
0
 

Author Comment

by:desmondwkng
ID: 37764277
ssaqibh

thanks

desmond
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question