Close Window   
Free Ebook
Get Your Free Excel
ebook!
Our Top 15 Excel Tutorials
Instant Access!
E-mail:
Subscribe for Free Excel tips & more!
E-mail:
Advertisements



Paste Csv Data Into An Xls Sheet In The Correct Columns

Forum Register
Search Excel Forum Posts, Tutorials, Macros, Tips, and More

Hi guys,

I'm using a vba script to copy paste the content from a csv file into an xls sheet. I used it in Excel 2000 and it works fine. The csv data is pasted into separate columns (all the data is pasted in columns A to F). When I use the same script in Excel 2003 the csv data is pasted as a single line (all the data is pasted in column A). Anybody knows what I'm doing wrong here ?

Bananas

View Answers     

Similar Excel Tutorials

Quickly Switch the Columns and Rows of a Data Set in Excel
How to switch a data set in Excel so that the columns become rows and the rows become columns. This will save you ...
Print Specific Rows or Columns on Each Page in Excel
How to repeat specific rows or columns on every printed page so that you know what each column or row means when y ...
Get the Name of a Worksheet in Macros VBA in Excel
How to get the name of a worksheet in Excel using VBA and Macros and also how to store that name in a variable for ...
Quickly Move Cells Around a worksheet in Excel Cut/Paste Trick
Moving Cells around a worksheet in Excel is fast an easy. Below I have a table of forenames, surnames and ages. As ...

Helpful Excel Macros

Filter Data Sets on Multiple Columns with Multiple Criteria at Once in Excel - AutoFilter
- This Excel macro allows you to filter a data set on multiple columns and criteria at once. This means that you can filt
Reverse Row or Column Order in a Worksheet
- This macro reverses the order of a selected row or column in excel. It will completely reverse the data.
Sort Data that Doesn't Have Headers in Ascending Order in Excel
- Sort data that doesn't have headers in ascending order in Excel with this macro. This is a simple sort macro that assum
Vlookup Macro to Return All Matching Results and Stack them with Previous Results
- This is very similar to the other Vlookup type Macro in that it returns all of the results that match a particular se
Save the Current Worksheet as a New Excel Workbook File
- This Excel Macro will save the currently visible/active worksheet (the one that you see when you run the macro) to a

Similar Topics







I need help for a VBA script /Macro for this following problem. Please help;

I have two worksheet (say DCR-M and DCR-W) in a workbook. DCR-M has A,B,C,D,E columns. DCR-W has C,D,B columns. Please note, C,D,B, column headers of both sheet are same. I every day copy data from an another workbook (say DSR) and paste them in DCR-M.
What I need is
(a) as soon as I paste data in DCR-M, all pasted rows (only currently pasted rows,not previously pasted rows) having data of B, C, D column should automatically paste in respective column C,D,B of DCR-W sheet based on the condition/criteria that if E column of DCR-M sheet's cell value = "T2"
I need a macro/VBA script for this.

Please help. Thanks
Nmt

Hey everyone, I'm hoping you can help me with this.

I'm currently working on an excel file with a lot of data, and multiple columns.

The data needs to be arranged in certain ways for printing and viewing.

As an example:
say that columns A through C are common to everything, so they are copied off the "master sheet" and pasted on all the following sheets I created. After that, the data from column D to E is from one department, so that is pasted on the second sheet next to the common values. Then data from columns F to H is from another department and pasted on the third sheet next to the common values... and so on

What I have done so far is make about 18 different tabs and I have a macro that will take all the appropriate columns and copy and paste them in their respective worksheet tab.

But the data on the "master sheet" can also be filtered using the drop-down menus at the headder of each column.

This is where I run into a problem. When the data is filtered in that fashion and I run the macro, it will work fine up until about the 15th tab and then have an error that says, "excel cannot complete this task with available resources. Choose less data or close other applications."

This just seems strange because after the results are filtered there is less data to be copied and pasted.

Any help would be greatly appreciated, and if it is unclear please let me know how I can clear it up. I cannot paste a sample in here because I cannot make the filesize small enough, so I will try my best to explain it.

thanks in advance




I have spreadsheet with data in A1:Z5 and I would like to have cut and paste 3 joint columns from within A1:Z5 into A10:C14 which is the fixed location for the chosen data. The difficulty is that I need a Macro that can forward or backward the 3 joint columns from A1:Z5 to be pasted to A10:C14.

Example I start with data in A1:C5 and have them pasted in A1:C14. The next step I want to "forward" and the chosen 3 column, B1:D5 will be pasted in A10:C14. The next forward VBA will paste C1:E5 in A10:C14. If I do a "backward" from here , then B1:D5 will be pasted in A10:C14.

Appreciate help in the VBA coding as my simple record macro can only help me do the first step.



Please Login or Register  to view this content.



Hi ,

I need an help in creating macro for doing two tasks

1.To copy the data from one sheet to new sheet in same excel based on a particular column.Column C will have multiple values and these values might repeat ,so i need the macro to put filter on that column and copy paste the relevant details to new sheet for all the values in that column.

2.The other macro has to paste the data in a specified order in a different excel sheet.For this the output given by first macro will be used, the new sheets which the first macro created will be pasted in a order in different excel by using second macro.

First Macro Order to copy paste in second Macro
Column B Column C
Column E Column G
Column D Column E

The column B of first macro has to be pasted in column C by using the second Macro in the similar way the other two columns also has to pasted.Once this done it has to leave a line and again it has to paste the same data.

Can you please help in doing this.
I have attached the outputs of the two files to show how it looks.
I hope this helps in creating a macro.
Eagerly waiting for a quick reply


Hi ,

I need an help in creating macro for doing two tasks

1.To copy the data from one sheet to new sheet in same excel based on a particular column.Column C will have multiple values and these values might repeat ,so i need the macro to put filter on that column and copy paste the relevant details to new sheet for all the values in that column.

2.The other macro has to paste the data in a specified order in a different excel sheet.For this the output given by first macro will be used, the new sheets which the first macro created will be pasted in a order in different excel by using second macro.

First Macro Order to copy paste in second Macro
Column B Column C
Column E Column G
Column D Column E

The column B of first macro has to be pasted in column C by using the second Macro in the similar way the other two columns also has to pasted.Once this done it has to leave a line and again it has to paste the same data.

Can you please help in doing this.
I have attached the outputs of the two files to show how it looks.
I hope this helps in creating a macro.
Eagerly waiting for a quick reply.


I have the following simplified example:
Table with three columns with a growing number of rows. The first column contains an attribute that will be the condition on which to copy and paste the entire row into the appropriate different worksheet. For example, in my attached file, the first row contains the value "Square" . I want that row, and all "Square Rows" to be copied and pasted into the 2nd tab of the worksheet (reserved for "Square" data) on the next free line. Simiarly, Triangles should be pasted on the thrid tab.
My guess is that i will need a VB script to accomplish this and go through the entire contents of the first sheet containing the data and see if value= "Square" and then copy the rows to the appropriate worksheet. ANy help is much appreciated!




Hi,

I've spent about an hour searching this forum and the internet, but I can't seem to find someone with the exact same situation. I have a workbook with many sheets of similar but not identical data. I need to extract columns from each sheet based on 5 header criteria and paste them to a single sheet. Each worksheet contains these 5 criteria.


I've been working with the VBA script I've pasted below. It's grabbing the 5 column criteria that I have in sheet 12, and comparing them to sheet 1 in the workbook, then copying them to sheet 12. This much is good, but I need the script to also return the data from the other worksheets as well. I've tried modifying the script based on other loop functions in other scripts I've found, but I'm not having any luck.



Please Login or Register  to view this content.



Ive simplified my data and have the following example:
Table with three columns with a growing number of rows. The first column contains an attribute that will be the condition on which to copy and paste the entire row into a table on the next sheet. For example, I the first row contains the value "Square" . I want that row, and all "Square Rows" to be copied and pasted into the 2nd tab of the worksheet (reserved for Squares) on the next free line. Simiarly, Triangles should be pasted on the thrid tab. I guess i need a VB script to accomplish this and go through the entire contents of the first sheet and copy the rows to the appropriate table. ANy help is much appreciated!


Hi

I have column headers in Row 1.
I have a button that should paste approx. 20 rows of external data starting at the next empty row for columns A:I
Upon paste, columns J:T should autofill with formulae for all the newly pasted rows and only the newly pasted rows. Approx 20 rows pasted at a time, but could be less.

This process will be repeated many times so the initial hit of the Paste button will paste for A2:I21, the next paste will paste rows 22-41.

I would also like the columns J:T to be locked once the paste / autofill has occurred.

If the clipboard is empty, an error message would be helpful.

Any assistance... most gratefully received.

Thanks, in advance

I have a range of data in sheet1 (for e.g.a1:a40) , now I want to paste the data in sheet2 horizontally with commas in it because I want to copy the data in another software horizontally.
The section numbers should have a comma in between and the last section should have a full stop as shown below. Also, if the data is big I want the data to be pasted from a1 to a15 and then the sixteenth section should get pasted in the next column. i.e. from b1 to b15 and then c1 to c15.

For instance, my data is in a1:a4 is as below.
215
250
298
300
then I want to paste the data in that software as shown below ,so for that I want my data to get pasted in sheet 2 so that I can copy and paste it in that softwa -

The following are the sections
215, 250, 298, 300.




I have a sheet with a wide range of data, I'm trying to figure how to write a macro that will sort and select a certain range based specific criteria and copy a range of data based on the met criteria and paste it into another worksheet. I will be updated the values in the sheet, and the data size will vary, so the amount of data being copied and pasted will change.

I have attached a workbook for reference. So for example on sheet 1, I want the macro to select cells that have value V0010 in column A, 210 in column B, 40000 to 49999 in column D. For the cells that meet this criteria I want to copy columns A to Q, and paste starting in A5 on sheet 2 and delete any data previously in the range A5 to Q300 so I don't get the new pasted and old pasted information mixed together.

Hi Guys,

To cut a long story short, I'm pasting data from sheet A to sheet B using paste values. The data in sheet A could expand (by rows) so blank cells end up being pasted into sheet B. When I use a CONTA function in sheet B the blank pasted cells get counted.

The blank cells need to be pasted but must not register as containing anything. Any ideas? (vba if possible as I'm using a macro for the paste)

Thanks for your time.


Hi,

I have some data in sheet1 with 10 columns and 5000 rows.
I want to filter the data with 2 criterios.

When I go to 4th column and Click custom filter, I will give one criteria and select "or" and give another criteria. SO I will get the result in sheet1, I need to copy the data and paste the same in sheet 2 with the header.

The problem is, I need to filter more than 20 times giving the criteria and copy the result and paste in sheet 2 one after the other.

So i need a macro to solve this time consuming work.

I just paste the two criteria either in a text box or some cells and run the macro. the macro has to filter the data in sheet1 based on my input.( that is criteria1 or criteria 2) and the result should be pasted in sheet2 with the headers.
Again I delete the values in my input cell, and paste the new values, and run the macro, that result should be pasted after the first result, with the header. (would be great if that is pasted leaving one row above, that is if the first result is pasted in sheet 2 till 10th Row, then the send result should be pasted in 12th row and so on..

the similar kind of question with some changes, I posted in the below link with
http://www.excelforum.com/excel-prog...in-sheet2.html

I guess bit complecated, I would appreciate If I get helps

Arvind..


I have created an excel template file that users will be pasting data into, from other excel spreadsheets. The first column of data is numeric (integer). Somebody pasted data for which the first row contained a number that had an warning that said "The number in this cell is formatted as text ...", and that warning was carried over into the pasted worksheet. We are using this template file to upload data into an asp.Net application, and because of this warning, the data for that cell was blank.

Is there any way to lock cell formatting so that when a user pastes data, it converts the data to numeric, or doesn't allow the data to paste, or something like that?

I want to allow for data to be pasted, but I want to enforce some kind of data typing on the pasted data??


Hey all. I am needing some sort of script or whatever to run when a spreadsheet is opened, copy a set of cells, paste as values only into a 2 columns the first time opened, then the next two columns the next time it is opened.....and then lock the cells down from manipulation after the data is pasted in.

0.69037 FALSE 0.85656 TRUE 0.88652 TRUE 0.90457 TRUE 0.43288 FALSE 0.04183 FALSE 0.77576 FALSE

So assuming this data (above) was in columns B & C, the script would copy those cells, paste as values into E & F, and lock them. Then the next time the file is opened, it would copy those cells, and paste them into G & H, and lock them.

I have no idea about how to achieve this. Could anyone possibly help with this? Any help would be greatly appreciated.


I am new this forum and not much knowledge about Macro's.
Attach is the excel file where Column A and B contains Sales Data for 2 days...seperated by diff color and new data starts with text
ie REG_CNTR REG_TOTAL

Similary Column D thru F consists of Employee Clock IN-OUT data.

This only shows 2 days but i need a macro (Button) so that with a click of a button it organize data as shown in Column I thru K for Day1,then blank column, then Column M thru O for Day2, and so on....

For Information :
Day 1 Data from A2 thru B61 is pasted in J2 thru K61....ClockIn_Out data is pasted on I64 thru K72
Day 2 Data from A63 thru B122 is pasted in N2 thru O61....ClockIn_Out data is pasted on M64 thru O69

i hope the above is clear explanation..

Help is greatly appreciated...

Thank U ...


Hi

I'm a bit of an excel beginner, so if this is a silly question then sorry. I have a workbook with multiple worksheets. Sheet 1 will contain all of the content of information on all of the following sheets. The following sheets have specific parts of sheet 1. So, I want any information in sheet 1 that is relevant automatically pasted into the right column in the right worksheet that follows, and visa versa. So, if Sheet 1 column A and sheet 2 column A have the same data they should be the same no matter which sheet the data is inputted into. I've tried using a pasted link, but inputing data into the cell overwrites the pasted link code and it become a normal cell, so that after being used once i can't go and change info in that cell and have it automatically copied into sheets with the same column. I've also tried =Sheet!A1 but that just seems like a manual way of writing a pasted link. So, is there a way of making a circular referenced pasted link that can have data repeatedly put in and changed and still work?

Thank you in advance


In Excel 2000 I would receive the following warning message whenever I would
paste data to an area that was not the same length as the copy area. The
warning message was "the copy area and the paste area are not the same size
and shape."
In both excel 2000 and 2003 I am using the "paste special value" function.
The warning was useful for me because it made sure I was copying / pasting
data to the correct area. The problem is now that I am working with excel
2003 that functionality seems to gone. In excel 2003 I no longer receive the
warning message that says that the copy area is not the same as the paste
area. Whenever I do a copy and paste in exel 2003 the information is pasted
regardless of how many cells I select the pasted area to be. Is their a way
to turn this warning message on in excel 2003?



Hello All,

When I try to copy-paste data into a sheet Excel is splitting it into
columns using the white-space-charecter as a delimiter. How can i stop this ? It was working fine earlier(the pasted data was all in the first column)

Thanks for any suggestions......


Hi,
Can anyone help me with a maco for this task?

Here is a short example explaining the case

Say there are 10 columns in a sheet and they are numbered 1-10 and say there are 26 rows numbered a-z. (Columns information start from C2 and rows start from B3). Hence altogether there are 260 cells in this range. (range is C3:L28)

Row 30 (range C30:L30) has a unique number in each of the columns and these are to be copied and pasted in the cells of the required column only (numbers in column 1 should be pasted in the cell of Column 1 only and numbers in column 2 should be pasted in the required cells of Column 2 only)

Like:
1) A number (say 520) is already placed in the cell C30 this should be copied and pasted in the column C only where ever X is written. (range C3:C28, X could be written only in 5 places, hence the number 530 should be pasted in these all these 5 cells) similarly


2) A number (say 900) is already placed in the cell D30 this should be copied and pasted in the column D only where ever X is written. (range D3:D28, X could be written only in 1 places, hence the number 900 should be pasted in only 1 cell) similarly


3) A number (say 64) is already placed in the cell E30 this should be copied and pasted in the column E only where ever X is written. (range E3:E28, X could be written in 20 places, hence the number 64 should be pasted in these 20 cells) and so on for all the range.

4) A number (say 64) is already placed in the cell E30 and the column has no X written in the range then no number should be placed in the range. (range E3:E28, X could not be written in any places, hence the number 64 should not be pasted in any of the cells) and so on for all the ranges.

As I originally have to perform this task for ‘n’ number of rows and columns in the worksheet, say for 40,000 cells in a sheet spread across columns and rows, I guess the macro would initially ask me to submit a range before starting.

Naveen

Ex:
Data 1 2 3 4 5 6 7 8 9 10 a x x x - x - - - x - b x - - x x x - - - - c - x x - x - - - - - d - x x x x x - - x -




Hi there,

I'm working on a macro that will copy a row of info and then paste it into the next 7 rows, then when new information is entered into the last free row that row will also be copied and pasted into the subsequent rows. So I want to create a process where if you were to click and drag the information on an excel sheet, it would create an autofill effect. So for instance, "A1:D1" has the information, but I want the information in there to be copied and pasted until "A8:D8". Then another row of data is entered into "A9:D9" and it will be copied and pasted until "A17:D17". The number of rows it will be pasted to won't change.

Is there any coding I could use to help me?

I've already looked at the following thread:
http://www.excelforum.com/excel-gene...tomate-it.html

However, it was looking at pasting into other columns.

I'd appreciate any help I can get - thanks!



Hello, just wondering if someone can help me please. I have a 3 userforms with textboxes and command buttons. When the user clicks the last command button on each userform all the data from the textboxes on that userform are concatenated and put in a string on a worksheet (sheet4). This works fine for userform1 as i simply state i want it pasted in rangeA2 on sheet4. However, when i do the same for userform2 and 3 I want this data to be pasted in sheet 4 straight after the last character that was pasted from userform1. I cant just say paste in location of cell A2 for example because each character does not have its own cell, its just simply pasted in a long string. Does anyone know how i can state the location so that the string from userform2 can be pasted in following on from the userform1 data?

Thankyou for any help

Hello,

I have a file which has columns of data in one sheet - I need to take the columns, copy the data and paste it in sheet two.

The problem I have is I need to paste the data into one column on sheet two - instead of it being across the sheet.

So I need some code that will copy all data in the range, paste it into sheet two looping through pasting each new column on the bottom of what was previously pasted.

Can anyone help?


Hi there,

I have an excel file with data that has 7 columns and 912 rows. I want to take the first row and copy it into 10 rows. Then take the second row and copy it into the next 10 rows, and take the third row and copy it into the next 10 rows and so on for all rows.

Please download the file here https://fileexchange.imperial.ac.uk/.../RowtoRows.xls



In the attached file, on the left hand side I have my 7 columns and 912 rows (A2:G913) . To the right of this, I have created a sample of what I am trying to achieve. I have copy&pasted A3:G3 into J3:P12, also copy pasted A4:G4 into J13:P22 etc etc (this is what I am trying to achieve but for all rows)

What formula can I use to do this quickly as it will take a long time to copy&paste manually?

Thanks in advance.


I have two reports I must run every month. One excel sheet has 3 columns of data and the other sheet has 30 columns of data. I need to be able to do this quickly without having to manually copy/paste the data as there are over 600 rows. The rows are of customer purchases and one customer may be listed multiple times if they have multiple transactions.

I have attached two samples sheet. I need to paste data from sheet 2 to sheet 1 and make sure the data is pasted on the correct row for the correct person. If we sort the rows never match perfectly, so we have to manually do it which takes time and leaves room for user error.

So...how can I copy the rows from one sheet to the correct row on the other sheet? I'm sure there is a way to use some type of code, but I'm a novice so any and all help is welcome and appreciated!

Thank you!