Solved

VBA Excel - Copy a cell range to next blank range

Posted on 2013-01-19
3
604 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

733 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