Solved

VBA Excel - Copy a cell range to next blank range

Posted on 2013-01-19
3
570 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

771 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

8 Experts available now in Live!

Get 1:1 Help Now