Link to home
Start Free TrialLog in
Avatar of ADRIANA P
ADRIANA PFlag for United States of America

asked on

need copy macro to select range to copy

Need copy data from an range to paste to other
Avatar of Bill Prew
Bill Prew

How will the ranges be specified / determined, will they just be hardcode like copy A1:B2 to X1:Y2, or is there user input, etc?

~bp
Avatar of ADRIANA P

ASKER

Bill Prew thanks !!

for you fast response

will help a lot it can be the option to select the range
like when you do to setup an pivot table
So, can the user select the source range, then invoke the macro which will identify the currently selected cells as the range to copy from?

Or, do you want them to run the macro which then instructs them to select the range then before doing the copy.

The first approach is more typical...

Also, where should the range of data be copied to?


»bp
Bill Prew

So, can the user select the source range, then invoke the macro which will identify the currently selected cells as the range to copy from?
can be !

the destination could be other woorkbook or the same
as needed
So how will the macro know what the destination to copy to is?

~bp
Bill Prew

well is poissible to select the destination ??

because can vary
You can select ranges with this
Dim range As Range
Set range = Application.InputBox("Select a range", "Range", Type:=8)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Shaun Vermaak  Thanks !!!
 

Bill Prew  
is not working  don't let me paste the data selected
It works fine here, please explain in more detail the steps and clicks you are doing, and the results you are getting.

~bp
Bill Prew
don't let me paste the data selected
The paste is part of the macro, you don't do it manually after.

The steps are:
  • Select a single range of cells to copy
  • Click on the "DoCopy" button
  • When prompted, click on the cell(s) where you want the data copied to
  • Click OK button

Data will be copied at new location.


»bp
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Bill Prew
User generated image
Shums thanks thats working !!
You got the error on mine because you did not select the destination location.

~bp
I believe there was misunderstanding.  Bill, she wanted input box to select range to copy and input box to select range to paste.

Not sure I would call it a misunderstanding, I would call it misstated if that is the case...

So, can the user select the source range, then invoke the macro which will identify the currently selected cells as the range to copy from?
can be !


»bp
YES I DID Bill Prew
User generated image
Adriana,

In your screen capture notice that there is nothing filled in inside the "Please select the destination range" box.  That indicates nothing was selected for the destination (not source) before the OK button was pressed.


»bp
Bill Prew I DID !
BUT NOTHING HAPPENS GOOD FRIEND !
Thanks !! great Experts !!
This is awesome....is there a way this can work when there is a formula in the field for example vlookup and when it copies, it's only copying the data instead of the error.