Solved

VBA Excel - Copy a cell range to next blank range

Posted on 2013-01-19
3
584 Views
Last Modified: 2013-01-20
Hi,

I am working on "Sheet4".

I need to cut cells from "FQ3:FQ63" (including formulas and formatting) and paste to the next blank column in the range "B3:FP63".

Can anyone help craft the macro code to do this?

Thankyou
0
Comment
Question by:mhdi
  • 2
3 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38797815
Do you want to cut-paste or copy-paste?

for cut-paste try

sheets("sheet4").range("FQ3:FQ63").move sheets("sheet4").range("FP4").end(xltoleft).offset(,1)

for copy-paste

sheets("sheet4").range("FQ3:FQ63").copy sheets("sheet4").range("FP4").end(xltoleft).offset(,1)
0
 

Author Comment

by:mhdi
ID: 38797823
Im getting this error: "object does not support this property or method"

This looks much better then my ForNext solution that I was attempting :)

Edit: I want to cut and paste (move)
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 38797840
Sorry it should have been cut instead of move

Sheets("sheet4").Range("FQ3:FQ63").Cut Sheets("sheet4").Range("FP3").End(xlToLeft).Offset(, 1)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel 2016 Not Responding Issues 6 27
InStr Function not working properly in macro 3 19
Boolean help 6 27
Mac Excel column treating text as date 2 30
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

912 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now