Email:      Pass:    Pass?
Close Window   
TE
Free Excel Tips in Your Email!
Join Over 20,000 Happy Subscribers!
E-mail:
Subscribe for Free Excel tips & more!
E-mail:


Advertisements


Free Excel Forum

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 Video Tutorials

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

Hi Guys,

I would like to know how I would go about inserting formula's once I have pasted data into a sheet.

Data will be initially pasted into column A3 running through to column X with a variable amount of rows (typically 300-400).

Once the data has been pasted I would then like the following formula's entered into columns Y & Z for each row of data.

Y =VLOOKUP(U3,'Sheet3!$A$2:$B$30,2)
Z =IF(Y30,Y3,IF(K3>0,"Y",IF(L3>0,"Y",IF(P3>0,"Y",IF(Q3>0,"Y","N")))))

Thanks in advance


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




Reference to my last post

http://www.excelforum.com/excel-prog...-workbook.html

The data is being passed ok now and all is good apart from 1 minor detail.

How can i split the data?

The data is pasted across 1 row matching the ID Field in column A.
Can i paste the data in - leaving a gap between the ID Field and the other data being pasted - 5 columns to the right would be ok.

Attachment 283447

Here is the code upto know:



Please Login or Register  to view this content.



Hello Every one,

i have a large wordlist containing Columns A, B and C. Now i have to cut and paste parts of B and C and paste them into DEFG. The content which hast to be cut and pasted has always the form "[?]"; "{}" or "{?".

Now all "[?]" from Column B has to be cut and pasted into Column D and the remaining whole content of column B (can be "{?}" or withouth {}) has to be pasted into Column E. The content in Column E should be bounded by {} if not already there.

And all "[?]" from Column C has to be cut and pasted into Column F. And all "{?}" from C has to be cut and pasted into Column G. In some entries of C "}" is missing. In that case "{?" has to be cut and pasted into G.

For example:

A---------B----------------C
w1------[a]{n.}---------m1[aa]{n.m.
w2------{n.}[p]---------m2[aa]{n.m.}
w3------[q]ajsk----------m3{n.m.
w4------ead-------------[aa]{n.m.}m4
w5-----------------------m5[aa]

has to look like(Coulmn B will get totally empty):

A----------B---------C---------D---------E---------F------G
w1------------------m1-------[a]--------{n.}-----[aa]-----{n.m.
w2------------------m2-------[p]--------{n.}-----[aa]-----{n.m.}
w3------------------m3-------[q]--------{ajsk}------------{n.m.
w4------------------m4------------------{ead}----[aa]----{n.m.}
w5------------------m5----------------------------[aa]-------------


Thank you very much for each help 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.




Hi there,

I have a table within my worksheet (example attached), and what I want to do is copy and paste data from individual columns so that they are listed underneath each other. So I basically want to cut the data in column 'Example 1' and paste them under the data in column 'Example', then delete the column it has just cut the data from, so that it shifts the columns to the left. Then I want to loop this process so that it cuts the data from column 'Example 2' and paste it under the data that I pasted from 'Example 1'. This is the code I'm using:



Please Login or Register  to view this content.


My problem is I get an error when it gets to Range("Paste3").Select. I tried to correct the problem with Range("C" & FinalRow9).Select, but it keep overwriting the data it has just cut and pasted from the previous column. I would appreciate any help you could give me on this.

Thanks!

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!


I have two files, a CSV export and then a template Excel file where I want to input the CSV data to.

Based on the values in column K and O of the CSV file, the data is to be imported and pasted into different columns to the Excel file.

First, some of the values in column K = 0 --- I want to ignore these rows

Second, if the value in column O of CSV file = *"Initial"*"Service"* (*=wildcard):
Column A of CSV file should be pasted to first open row in column B of Excel File
Column M of CSV file should be pasted to first open row in column A of Excel file
Column K of CSV file should be pasted to first open row in column C of Excel File

Next, if the value in column O of CSV file = *"Trashout"*:
Column A of CSV file should be pasted to first open row in column B of Excel File
Column M of CSV file should be pasted to first open row in column A of Excel file
Column K of CSV file should be pasted to first open row in column F of Excel File

Next, if the value in column O of CSV file = *"utility"*:
Column A of CSV file should be pasted to first open row in column B of Excel File
Column M of CSV file should be pasted to first open row in column A of Excel file
Column K of CSV file should be pasted to first open row in column G of Excel File

I have sample files available if necessary.

Pls help!




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.



Hi,

On a regular basis, I need to copy data from a system and post it to an excel worksheet. The problem is that when the data is pasted, there are blank alternate columns in the data range. I want to delete those blank columns (not the entire columns as there may be data on some of the columns above the row where the data range started. The data typically starts from cell B8 and the size of data across the rows and columns changes every time that data is pasted. I shall be grateful if a macro can be written to address this task. A sample of how the data looks when it is pasted and the end result is appended.

I have a Word doc which I receive montly. There are 8 columns of data in the word doc. When I copy and paste the data in Excel the 8 columns worth of data get pasted into column A with just spaces between the columns. How can I paste the data in excel so that the 8 columns from word get pasted into 8 columns in excel? I've tried all the paste specials and none of them worked.


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!




Hello,

I have a VB script that I am using on a workbook that basically hides a row, if the job is completed, by someone typing the word done in that row.
See code below:



Please Login or Register  to view this content.


My problem is, The sheet containing this data (as well as a few additional sheets using the same code), get copied and pasted into one sheet called overview.
I used the paste link option, so that when people work and make changes to a particular sheet, the Overview sheet will display the updated changes.

The problem is the Script to hide a row in the original tab works fine, if someone puts done in that row, but that is NOT reflected in the Overview sheet.
My guess is, because the cell contains =January!B11 (since its using the paste link option). So even though cell B11 in sheet January, contains the value "done" and therefore the row is hidden, the overview sheet still shows it, because it doesn't have the word "done" in the cell.

Is there anyway to get the Overview sheet tab to also hide that row, when the sheet from which that data was pasted from, hides that row?

I hope that makes sense?
any thoughts are greatly appreciated!
babs

I know nothing about programming or how to make a program work in Excel so please be gentle.

I have two sheets in the same workbook.

Sheet 1 contains data that is pasted in daily from another application. The data is hourly data so each day 24 rows are pasted. Each row ranges from column A through Column P. After the data is pasted I copy a row below the 24 new rows to total up the data in each column.

I want to copy the values (not formula's) from the "total" row in sheet 1 and paste the entire row into sheet 2 in the next unused row if the value in column M is greater than 1079.

Basically sheet 1 will contain all of the raw data including a "total" row for each day and sheet 2 will contain only "total" row data that meets a certain criteria.

I would like the code to trigger this copy and paste function automatically if possible such as right after the "total" row is pasted into sheet 1.

Beggars can't be choosers but if it is possible please include comments so I can try to figure out what your code is doing. I have been looking for the answer for days and have become intrigued with what can be done so I want to learn more.

Thanks in advance.


Hello,

I am trying to find a VBA/macro that I can install that will basically go through each sheet and copy all the data and drop it into one main sheet.

For example, assume I have 5 sheets of data. I would like to be able to run a macro to copy all data from each sheet and paste into a master file so that data from Sheet 1 is pasted to a master file then data from sheet 2 is pasted at the next available row after sheet 1 data and so forth until all sheets have been copied.

I would think this would be somewhat simple since I am not trying to line up rows/colums. Just trying get all the data in a spreadsheet.

I am not as code savy as I should be so if someone could help with the beginging to end code, I would really appreciate it.

Couple of notes:

1. Each sheet may be differant with respect to rows/columns.
2. Number of sheets within a workbook will always vary
3. All data is text format
4. Columns do not have line up.


This could save me hours of work.

Thanks everyone.


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

Hi...
i want to save some paper and put the data in two separate spaces or columns.

Here's what the code should do.

Look for entries xl down, count no. of rows=34 and cut them first on columns A to G and do the same xl down but this time put the columns to I to O. and in next try, it should again cut paste to A to G to next available empty row xl UP. and then again xl UP I to O ... this should continue unless there is no value in sheet cells xl down.

1. Number of Rows to cut paste = 34 (1 to 34, 35 to 68 and so on... )
2. xl down detect last available cells = Column A to copy from
3. Value to cut is Range column A to G
4. xl up detect last available cells = Column A to paste at (for column A to G)
5. xl up detect last available cells = Column I to paste at (for column I to O)
6. Range of columns to be pasted in 1st try = A to G
7. Range of columns to be pasted in 2nd try = I to O
8. Loop command.

Hope somebody can built such a code.
Thanks a lot. help will be appreciated.


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 bunch of data (from Emails) that I need to transfer from a
Fixed Width format into Excel.

This AM, I pasted in about 10 messages worth, each message on it's own
worksheet and then put together some sample metrics, etc on a summary
page. Happy that I prettty much had what I wanted, including Macros to
convert the data from Text-to-Columns, I started to paste in the rest
of the data.

However, this time around, Excel is automatically reformatting the data
as Delimited as soon as I paste it in. How do I override this and force
Excel to not perform the Text-to-Columns as it is pasted in?

There is no Paste Special option to cover this.




Hello all, I have one file with dates by year in coumn (L) and normal data in columns A:K

I have another file with the tabs as years (2000, 2001, 2002, 2003 etc)

What i need automating is the data from the large file - to be copied and pasted (Coulms A:L) into the other file by specific tab. So all data that has year 2000 in column L - to be pasted into tab 2000 and so on.

Please help if this can be done.




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.