Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 628
  • Last Modified:

VBA Excel - Copy a cell range to next blank range

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
mhdi
Asked:
mhdi
  • 2
1 Solution
 
Saqib Husain, SyedEngineerCommented:
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
 
mhdiAuthor Commented:
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
 
Saqib Husain, SyedEngineerCommented:
Sorry it should have been cut instead of move

Sheets("sheet4").Range("FQ3:FQ63").Cut Sheets("sheet4").Range("FP3").End(xlToLeft).Offset(, 1)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now