Excel Macro to copy user selected data to new workbook

March 5, 2016 at 20:30:03
Specs: Windows 7

i was hoping if anyone can provide me code for the macro i need . in my case i have to select the data manually from the source sheet. the selected data range needs to be copied from the active worksheet to the destination workbook. the data should go into specific columns in the worksheet of destination workbook. I have very limited knowledge in coding. If it can be done it would reduce the data entry time drastically.

See More: Excel Macro to copy user selected data to new workbook

Report •

#1
March 6, 2016 at 06:45:49
I assume it can be done, but not without a lot more detail.

VBA code needs to know where the data is coming from and where it is going. If the user selects a range, that makes it easier, but the code would still need to know exactly where the data is going. Workbook name, Sheet name/number, the "specific columns" that you mentioned, etc.

If you can supply that detail, we can see what we can do for you. If you are going to post any example data, please click on the following line and read the instructions on how to post data in this forum.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
March 7, 2016 at 10:04:43
I appreciate you helping me out on this. It has become a pain area at my work. I want to share the excel files. Can u share the email id on which I can send the excel files.

Report •

#3
March 7, 2016 at 10:20:11
You can upload the files to a file sharing site such as zippyshare and then post the link back in this forum. Just make sure that you remove any personal/confidential data and make sure that we don't have to register at the file sharing site because odds are that we won't.

Posting the workbooks probably won't be enough. You'll also have to explain what you are trying to accomplish, either as text within the workbooks or in a post here in the forum. Please remember that we can't read minds so what may seem extremely simple to you is brand new to us. The harder it is for us to figure what you need done, the less likely we are to give up our free time to work on it.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Related Solutions

#4
March 7, 2016 at 10:41:42
Understood. I shall write in the notes in the workbook as u have requested and post the link here. Thanks again.

Report •

#5
March 8, 2016 at 10:39:57
Hi,

I have uploaded the files on zippyshare. the file are zipped using winrar.
The link is : http://www6.zippyshare.com/v/YjjnoW...
There are two excel files: 'SOURCE' & 'DESTINATION'.
'SOURCE'- replicates the Bill of material i hav to copy the data from.
'DESTINATION'- is the excel template in which i copy the data into which is further converted to .csv file. The .csv file is then uploaded into ERP system which we use in our organization.
I have added notes in each sheet for your reference and inputs you would require.


Report •

#6
March 8, 2016 at 15:46:55
When I access the zippyshare link, only one file is downloaded: SOURCE FILE

I have never known zippyshare to allow 2 files to be shared via a single link.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#7
March 8, 2016 at 19:46:14
I am sorry. i should have checked the link before sharing it. Lack of sleep is the culprit :).
The link for the destination file is
http://www111.zippyshare.com/v/AWNX...

i think i forgot to remove the password for 'SOURCE FILE'.
The password for 'SOURCE FILE' is : pg3

Appreciate you taking time to help me out.


Report •

#8
March 8, 2016 at 20:47:30
Speaking of sleep, that is what I am about to go do.

I won't be able to do anything with these files until tomorrow evening, US-EST (~20 hours from now)

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#9
March 9, 2016 at 19:48:25
I have looked at both files, as well as the notes in the file. There are a few things that are not clear to me.

re: "The requirement is to copy data from cell range 'A4' TO 'J20' of this sheet 'SOURCE' to destination file. "

When I look at the Destination file, I do not see the data from Column B:C or F:G of the SOURCE file. Does that mean that the data to be copy is actually from A4:A20, D4:E20 and H4:J20, not A4:J20?

re: "If we can select the data range by use of mouse would be really helpful"

If you have already specified the range to be copied, why does the data need to be selected with the mouse? Are you saying that it won't always be A4:A20, D4:E20 and H4:J20?

re: "If Possible, Value For Column 'A' And 'C' To Be Asked To The User At The Time Of Copying Data From Source File."

I assume this means that you want to present an InputBox to the user, at which time they will enter the values that should be placed A4:A20 and C4:C20 of the Destination
workbook, correct?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#10
March 9, 2016 at 21:03:47
re:"When I look at the Destination file, I do not see the data from Column B:C or F:G of the SOURCE file. Does that mean that the data to be copy is actually from A4:A20, D4:E20 and H4:J20, not A4:J20?"
Your understanding is absolutely correct.

re:"If you have already specified the range to be copied, why does the data need to be selected with the mouse? Are you saying that it won't always be A4:A20, D4:E20 and H4:J20?"
Yes it will be different. But the number of columns will be same. For a project we maintain Bill of material on multiple worksheets with number of columns on each sheet same. all columns are not required for the 'destination file'. The reason for selection using mouse is that it is easier for user.

re:"I assume this means that you want to present an InputBox to the user, at which time they will enter the values that should be placed A4:A20 and C4:C20 of the Destination
workbook, correct?"

Absolutely right. Exactly what i was looking for.


Report •

#11
March 10, 2016 at 06:39:56
You have now completely confused me.

I asked you this question:

Does that mean that the data to be copied is actually from A4:A20, D4:E20 and H4:J20?

To which you responded:

"Your understanding is absolutely correct."

I also asked:

Are you saying that it won't always be A4:A20, D4:E20 and H4:J20?"

To which you replied:

"Yes it will be different."

Please clarify how I can be "absolutely correct" that the data will be copied from A4:A20, D4:E20 and H4:J20 yet at the same time "it will be different".

I'm lost.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#12
March 17, 2016 at 04:44:15
Sorry for the delay in responding. What i was trying to say was that the columns will remain the same you mentioned 'A','D','H', 'G', 'I', 'J' , But row number may not be always starting from '4'. On a single worksheet i have multiple BOM which i need to export to 'DESTINATION' sheet shown by color coding.

Report •

Ask Question