Cut Data From Column And Paste To Rows

Nov 28, 2007

I'm in need of a macro that takes data from cells in column A and moves them into different cells. Each block of data includes a company name, contact name, address and usually (but not always) phone, fax, email, website, etc. I want to move each set of contact info into a set of cells that begin in column A, starting with company name. Refer to the attached spreadsheet

View 3 Replies


ADVERTISEMENT

Copy Data In Rows And Paste In Column

Apr 22, 2005

How do I create a macro that takes the 3 digits values in cells Q82:AJ86 and place them is column L, set code to start placing result in L38?

example
Q82=610
R82=611
S82=612
T82=613
Results
L38=610
L39=611
L40=612
L41=613

View 9 Replies View Related

Paste Rows Based On Data In A Column

Jul 24, 2007

I've been using a macro that, among other things, will split a set of data into different sheets based on one column. For example, if I have Column A populated with numbers 1-10, each entry with a "1" in column A gets pasted into a sheet entitled "1", and so on. Some of the numbers I group together (for example, let's say I would group the 2s and 3s together).

I've been using the code below, but it seems to be very fickle. Half the time I run the macro, I get a "Run-time error 1004" and it points to the line "Sheets.Add. Name = WhtSht". Is there a different (easier) way to accomplish what I'm trying to do?

Dim rng As Range, StrtSht As String, WhtSht As String
StrtSht = ActiveSheet.Name
For Each rng In Range("A1:A" & Range("A65536").End(xlUp).Row)
WhtSht = rng.Value
If WhtSht = "21" Then WhtSht = "7"
If WhtSht = "34" Then WhtSht = "33"
If WhtSht = "36" Then WhtSht = "33"
If WhtSht = "37" Then WhtSht = "33"
If WhtSht = "56" Then WhtSht = "55"
If WhtSht = "57" Then WhtSht = "55"
If WhtSht = "76" Then WhtSht = "75"
If WhtSht = "97" Then WhtSht = "96"
If SheetExists(WhtSht) Then
Rows(rng.Row).Copy
Sheets(WhtSht).Select
Range("A" & Range("A65536").End(xlUp).Row + 1).PasteSpecial xlPasteAll
Sheets(StrtSht).Select
Else
Sheets.Add.Name = WhtSht
Sheets(StrtSht).Select
Rows(rng.Row).Copy
Sheets(WhtSht).Select
Range("A1").PasteSpecial xlPasteAll
Sheets(StrtSht).Select
End If
Next

View 2 Replies View Related

Copy And Paste Down To All Unhidden Rows In A Column

Sep 16, 2006

I dont know if a vb code is at all possible to copy a formula in a cell in row 2 straight down that column until the last unhidden row in which there is at least a cell populated with values from the 256 cells in that last unhidden row. Then in that column, I want the cells that are filled with formulas to be converted to values.

All these unhidden rows are autofiltered with certain criteria. The left and right columns to the formulated cells does not necessarily filled with values as they can be blank. Row 1 has header names, and a formula can be any cell in row 2 at any one time and that is exactly the problem i faced so that to record a macro seems totally useless for me because the cell in row2 where I will begin with a formula varies every time.

Currently I go a long way by taking these steps:
Hghtlighting row1
Data/Filter/ Autofilter/
Select the header cell and click on drop-down filter
Select (Custom...) with criteria
Input formula on the cell in row2
Copy the formula
Press Shift+ArrowDown keys until the last unhidden row
Press Enter
Undo Autofilter
Select the column
Copy and Paste as values
Autofilter row1 again
Select the header cell, (Custom..) equal "#N/A" and "zero"
Continue next turn of formula..copy to last unhidden row, paste as values....

Me and other staff in my department are doing these long-winding steps endless of times, day in day out, until we are drained out and called quit. If there is a code that can do this, this is going to the greatest news ever for these people for that kind of work.

View 5 Replies View Related

Copying Only Rows With Data In First Column - Skipping Rows With Blank First Column

May 12, 2014

I have 2 columns of data E and F. Column E has 11 different words that randomly repeat, Column F has 10 years of dates, about 1,000 entries (10/11/12 format). Both columns values come from formulas.

I am trying to copy cells E & F to columns K & L starting in row 2 only if there is is data in column E (one of the 11 words) and skipping all others rows. Both the E & F values of tthe row must be copied together, i.e if text is in E45, then copy E45 and F45 into column K and L starting with K2 & L2. This is a task which will be repeated multiple times as data is replaced in columns A-D.

View 4 Replies View Related

Compare Rows In Column A And Copy/paste If They Are The Same Using A For Next Loop..

Jul 26, 2009

I have one column of names in excel. The column may contain more than one row with the same name but these rows with the same name will all be grouped together. This is an exampe (each name represents a row in column A):

ColumnAColumnB
andrewData
julieData
julieData
julieData
jonathanData
jonathanData


What I want to do is copy the rows with the same information, e,g, the rows with 'julie' above, paste them into a new spreadsheet and email this spreadsheet to specific email addresses and then do the same for 'jonathan'.

I can work out how to send an email using VBA but I am really stuck as to how to go through the rows and send the email in discrete 'chunks'. I have tried using a for next loop, looping through the rows and copying/pasting rows that are the same as the previous one into a new spreadsheet but this does it one row at a time.
If I include the instruction to email the spreadsheet within the loop this would also email the new spreadsheet one row of information at a time, i.e. three emails for 'julie' each containing a spreadsheet with one row of information on it, rather than one email containing one spreadsheet with all three rows on it.

View 4 Replies View Related

Copy/Paste Rows By Numerical Range In Column

May 8, 2008

I would like it to scan an entire column (column E) for rows of data that fall into a range of numbers chosen by the user (like maybe a list box or combo box in sheet 1) for example a number greater than or equal to 8 but less than or equal to 15 and copy all of the rows and columns of data across the entire sheet that fit the range from sheet 1 to sheet 2. I would like to use a separate list or combo box for the min and max values in which to search as seen in the example sheet 1 attached. I have tried the autofilters, custom filters and macro recorder with no success as it seems the filters do not like ranges of numbers.

View 3 Replies View Related

Pull Column Data (Sheet3) From Master.xls And Paste To Column 4, Sheet4 Of WorkingSS.xls

Feb 16, 2008

Pull Column Data (Sheet3) from Master.xls and past to Column 4, Sheet4 of WorkingSS.xls

I'm assuming this would be done with VBA or a really exotic macro.

The Funky Part would be that the WorkingSS.xls file column data is being copied/pasted too (WorkingSS1.xls or WorkingSS2.xls ect) the file may be different every time so I would need an insert in macro or VBA to "Choose File Please..." then continue.

The Master.xls workbook has spreadsheet lets say "Sheet1" in which I need all the data in Column A (except the header or cell A:1) copied TO WorkingSS1.xls on Sheet4, Column B, but Column B already has about 6000 rows of info, so I need it copied to the very end of (A:6001 although it will be different everytime) or the first empty cell at the bottom of that column.

next another Column from Master.xls workbook lets say "Sheet1" again in which I need all the data in lets say "Column B" copied to the WorkingSS1.xls on Sheet4, Column F. Caveat this time is that the data needs to copied to the same row as the first copy/past. So it would be pasted into F:6001. Double caveat is that the Column F contains no other data except for what we are about to paste in.

I have several more steps of automation to be done here but this is the beginning and a big hump I need to get past. The rest I think I can do.

View 9 Replies View Related

Vba Select Rows Based On Info In A Column, Then Paste Into New Workbook

Jul 7, 2009

I'm using excel 2003. I would like to select and copy rows of data within a worksheet of a workbook and then paste those rows into a newly created excel workbook. That is the easy part. The complication is that I would like the macro to select the rows based on a particular string value that will be impossible to specify in a fixed way (i.e., it will change from project to project). Let's say the variable that distinguishes the rows is location, so some are from Tokyo, some New York, and some from Paris. Using vba, how can one 'splice' the data into (in this case, three) seperate workbooks based on the string/values of another variable?

I am familiar with auto-filter, but in this case, I really do need to create seperate workbooks, rather than apply calculations to a selection of the data.

View 9 Replies View Related

Copy Paste Rows To Another Sheet Based On Column Criteria

Jan 17, 2007

I have a file that has two sheets, I have some formulas in the first sheet named "Data",What i would like to have is, If column G in the sheet Data is "Closed", then i want that particular row to be cut from the sheet " Data" and pated in to the Sheet "Done".

View 5 Replies View Related

Paste Formula Across Rows But Change Relative Cell Reference To Column From Row

May 26, 2009

I'm working on setting up a chart. The formula I'm using for cell B21 is this: =ROUND(F3,0) & " " & IF(E3<F3 ...

View 2 Replies View Related

Cut And Paste Single Column Data In Different Column According To Year

Dec 5, 2012

I have a file which is divided into 2011, 2012, 2013 and 2014 years in column A. I want these data in different column according to year. For example, Column E(2011), Column F(2012), Column G(2013) and Column H(2014).

Attaching sample a file with sample data to be converted.

It is also to be in consideration that data in column B and C should not be repeated and all year data should come in front of it.

I want this by coding or formula only. I dont want to use pivot table for this.

Expecting Result.jpg

View 7 Replies View Related

VBA Code To Copy And Paste To Specific Rows Based On Matching Column Header?

Dec 7, 2011

I have a spreadsheet and I was wondering if there is a way to copy from a specific range in say A1:A5 in Sheet1 and paste into Sheet2 where the column matches cell A1 in Sheet1.

I am trying to do this in VBA and I was wondering if there is a way to do this.

View 9 Replies View Related

VBA Code To Paste From Last Column With Data In It To Next Column

Oct 8, 2013

The data exists in a spreadsheet that has Data from Column B2:CQ18, but it needs to be dynamic and update anytime someone clicks the button (the button is fine and works with all the other Macros)

Here is the code I have so far.

Code:
Dim LastCol As Range
Dim NextColPaste As Range
With Worksheets("Run Hours")
Set LastCol = Range("M3:M18").End(xlToRight)
Set NextColPaste = LastCol.Offset(, 1)
LastCol.Select
End With

That Code will Select the data in row 3 only and not the whole range of 3:18

I have tried Range (LastColData & "3:18").Select and that selects everything on the whole page from row 18 down.

I have done a lot of searching and for some reason this dynamic selection and pasting of data is escaping me this morning

View 1 Replies View Related

In Macro Copy And Paste Just To All Rows Where There Is Data?

Dec 6, 2013

The number of rows in my spreadsheet will change. I am creating a Macro to insert a column and enter a formula in the second cell of the new column. I need to copy that formula down through that column to the last row, but don't know how many rows there might be that day.

View 2 Replies View Related

Locate Data And Copy/Paste X Rows

Jul 11, 2006

I needed to find "406" which is in A5280 copy the previous 160 rows X 3 columns to A5281.

Because of other factors involved I now realise it would be better to have the macro do the following.

1. Find "04/06" (in A5123)
2. Copy from 2 rows above this cell (A5121) down to (C5280)
3. Paste into A5281

Sub ACopy3()

Const intRowsToCopy As Integer = 160
Dim rngFound As Range
Dim Ro
Dim Col

Application. ScreenUpdating = False
Set rngFound = Columns("A:A").Find(What:="406", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
Range(rngFound.Offset((intRowsToCopy - 1) * (-1), 2), rngFound).Copy rngFound.Offset(1, 0)
Application.ScreenUpdating = True
End Sub

View 9 Replies View Related

Copy Data From Another Workbook And Paste The Data From According To The Column Title

Dec 9, 2008

I have a time card report which will record the time spent on work for each employee. Each month, i have to generate the time card report and copy the data to my master file. Is there any code that can auto copy the time card entry directly to the master file? I only need some of the entry on the time card report, some of the column can be ignored.

I was thinking of creating a macro that will prompt me to choose the file to import as there are different file for different individual. Attach here with the master list (Demo.xls) & the time card for one individual (Nov-KTTHAM.xls) for reference.

I want to copy the data on column B of the time card to the column A of the master list, column C to column B, column D to column C, column E to column D, column F to column E and column G to column G.

View 4 Replies View Related

Copy Column Of Data And Paste To A Row

Mar 25, 2014

I am trying to copy data from one workbook to another. I have an excel Database (Sheet1) with a macro that prompts the user to select an excel workbook which has the data I'm trying to copy.... I got this part down....From this opened workbook, I want to copy the Range("C2:C12") and paste into my database(Sheet1) workbook.

However, I need a dialog box to pop up for a user input to designate which row the data must be pasted into. The dialog box will search column H in the database (Sheet1) workbook to designate the appropriate Row # in which the data will be pasted.

Now the ranged that I copied earlier will need to be pasted selectively if possible. Range C2:C8 will be pasted from Column HG:HM and C9:C12 will be pasted from HO:HR. Is it possible to selectively paste a range in such a manner or should I just split it up? I'm not really sure the order in which I should do these commands or how to go back & forth from one workbook to another. I would like for the workbook filename to not be a factor.

View 9 Replies View Related

Macro To Copy Data From Columns And Paste In Rows After Given Criteria Matches?

Nov 21, 2011

I have a macro that would check data in Column A and validate if a particular number is repeating, then for that number go to column B, Take the Values from there go to a new sheet and paste the values in a row.

CurrencyDateRef CodeIDAccountAmountDes.USD07152011XDVU4315210.4200.C5001.USD-18,606,772.190Distr Payable 07152011USD07152011XDVU4315210.4200.C5002.USD-111,131.450Distr Payable 07152011USD07152011XDVU4315420.4240.C5001.USD18,606,772.190Distr Payable 07152011USD07152011XDVU4315420.4240.C5002.USD111,131.450Distr Payable 07152011

I get the data in the below format

CurrencyDateRef CodeIDAccountAccountAmountDes.USD07152011XDVU4315210.4200.C5001.USD420.4240.C5001.USD-18,606,772.190Distr Payable 07152011USD07152011XDVU4315210.4200.C5002.USD420.4240.C5002.USD-111,131.450Distr Payable 07152011

I need to the macro to get the data not from the second cell.

Below is my macro

Sub test()
Dim idRange As Range, c As Range
Dim uniqueID As String
Dim destSht As Worksheet, sourceSheet As Worksheet
Dim r As Long
Dim i As Integer
Dim map As Object, key, item

[code]....

View 2 Replies View Related

Copy And Paste Data Based On Yes Or No In Column?

Jan 30, 2014

I have an Excel Spread Sheet that lists all of the people who have been issued Keys in your workplace, so the row has multiple information columns (Name, Department, Key Code, etc). One row is titled "Left Workplace" and you can select either a Yes or a No. Based on that selction I want it to copy and paste into a different spreadsheet (Either Inactive - if "No" is selected or Active - if "Yes" is selected) What is the best way to go about this?

View 2 Replies View Related

Getting Data From One Column Into Anothe Without Copy Paste

Jan 29, 2008

In the .xls I am working there is a column with miscellaneous info about the job such as "Copy machine HP3X1A requires service"

I have been charged with going through 1 year's worth of calls (1248) and pulling that printer name (the "HP3X1A) out of the misc. column and putting it into a new column titled "Printer Name"

The printer names vary a bit but usually start with the same three letters.

Is there any function or formula or whatever I can use that will be able to identify these printer names and export them to another column?

i.e. COPY all "HQPxxx" from column 7 and PASTE to column 2

This would save my an ungodly amount of time. I've been doing it for a bit less than an hour and I'm only on to October.

View 14 Replies View Related

Copy The Data From Other Column And Paste With ALT Enter

Mar 10, 2009

i face a problem with this, refer to the Book1.xls. i don't know how to explain it. it is very simple but i don know how to do it.

View 2 Replies View Related

Copy And Paste Data If Row In Column N Is Empty.

Dec 29, 2009

Copy and paste data if row in Column N is empty.
Here is my current code

View 2 Replies View Related

How To Count A Column If It Matches Data From Another Column In Seperate Rows

Feb 6, 2009

I have two columns with dates. Colum A has the date of the deadline of a document while column b has the day it was sent. Column X will display the difference if its a positive integer ( i.e. if the document has been sent after the deadline). Now i have another column Y which displays the month as an integer of when the document was actually received.

Now i need a counter which will count the number of instances a positive integer is registered in column X according to the month in column Y. I have been trying everything but cant figure a simple way to do it. Im doing this so i can be able to see how many documents are sent after the deadline per month.

View 14 Replies View Related

Transpose Rows Keeping Heading In Column A And Data In Column B

Mar 2, 2011

I have an excel spread sheet with several rows of 265 (9A-IV) columns each with a heading. I would like to transpose the worksheet columns so that the heading is placed in Column A against the corresponding that is placed in column B. For example

ABCD14692571038Transpose to A1A2A3B4B5C6C7C8D9D10

View 7 Replies View Related

Copy And Paste Values Based On Column Data

Jan 28, 2014

I would like to copy and paste the values from a worksheet (HS-Detail) in a file to different tabs depending on the value in column A (Regions). I have a macro that works but it pastes the formulas and it takes quiet a while to run due to the number of records. How can I alter this to paste just the values and speed up the macro?

[Code] ......

View 3 Replies View Related

Match Column Headings - Copy And Paste Data

Jan 23, 2014

I have a workbook with 2 worksheets, Sheet1 and Sheet2 have the same column headings in Row 1 but they are not in the same positions.

What I need to do is read the column header in Sheet2 Column A (Cell A1) and copy the data from A2 to last row and paste it in Sheet1 in the first empty cell under the same column heading, which may be the Column D position instead of Column A like in Sheet2.

It needs to loop through all the columns in Sheet2, copying the relevant data to under the correct header in Sheet1.

View 2 Replies View Related

Copy Data If Filled, Paste In Next Available Column In A Range

Aug 8, 2006

Ive been trying to find out how i can paste information in the next available column but between certain columns. Here is an example of what im trying to do. There is a calculator which represents 3 machines. It runs different senerios if you change the % of product going into it (cells to change this are light blue). What im trying to do is take the information the machine outputs to the right and organize it on the next worksheet.

The data on the next worksheet is a combination of all the machines performance (in yellow) together and the machines personal performance (in red). when the button is pushed currently, I have the overall scenerios information filling down rows. What I would also like it to do is see if im using a machine (because it can be turned off by changing the usage to 0%), and if I am, copy the results form the individual machine to the next worksheet. When it copies it needs to see if the first machine slot is open and if not the second and paste in the available location. I cant have a specific spot for each machine on the real worksheet cause there are maybe 100 machines and if 15 are used I only want the first 15 machine info slots filled and im gonna hide the rest of the columns. The way the columns fill also cant be like the rows where it looks for next available free spot. It has to only be for the specific range in red because there is info to the right of where this is going.

Sub Send_Data()
Sheets("Calculator Sheet").Select
Range("AD9, AE9, AG9").Copy
Sheets("output sheet").Select
Range("B65536").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub

View 2 Replies View Related

Adding Column Minus Rows That Have Data In Another Column

Feb 15, 2007

I want a cell on one spreadsheet (SP-A) to add up a column (M) in another spreadsheet (SP-B) rows 11 through 10000.

Here's the thing, I want that cell to actually display not the sum that it gets but that sum minus all numbers (in M column again) which column E is filled out with any data for their given row...

i'm not even sure if this makes sense lol... let me use example

on SP-B there's a column M.
in row 11, value = 3
in row 12, value = 5, in this same row column E is filled with whatever
in row 13, value = 2, in this same row column E is filled with whatever
in row 14, value = 6

in my SP-A I need the cell to display 9, since rows 12 and 13 have values in E and I don't want to add those to the sum.

View 9 Replies View Related

Convert From Text To Column And Paste The Converted Data In Other Sheets?

Apr 18, 2014

I want some vbs code on my 'Copy All' button in Email Data sheet which will do my work. Its a bit lengthy but who knows the concept will find it easy.

I have one sheets -

Sheet attached - Worksheet .xlsm

Workshet.xlsm [Data in 'Mod' sheet i)should convert from text to column and paste in 'Row Data' sheet ii) then transfer form Row Data sheet to 'Email Data' sheet 'Mobile Data' sheet and 'Other Data' sheet when Copy All button is clicked in Email Data sheet.

There should be some logic which will fetch appropriate date from 'Mod' sheet to the respective sheet . We can have some kind of logic like

If 'Register' found then take the value of register and workstation and paste in Email Data sheet.

All data below should be fetched from Row Data sheet which is blank now and will get the data when we click the Copy All button ,

1st Register Count:

Below Register Count (*) i.e. 16 If workstation count present copy to E15 in Email Data sheet in Table B

Below Register Count (*) i.e. 9 If register count present copy to E16 in Email Data sheet Table B

2nd Register Count:

Below Register Count (*) i.e. 8942 If workstation count present copy to C15 in Email Data sheet in Table B
Below Register Count (*) i.e. 2883 If register count present copy to C16 in Email Data sheet in Table B

3rd Register Count:

Below Register Count (*) i.e. 0 If workstation count present copy to E18 in Email Data sheet in Table B

Below Register Count (*) i.e. 1 If register count present copy to E19 in Email Data sheet in Table B

4th Register Count:
Below Register Count (*) i.e. 98 If workstation count present copy to C18 in Email Data sheet in Table B
Below Register Count (*) i.e. 999 If register count present copy to C19 in Email Data sheet in Table B

Substr:
B32:B44 will be pasted in C29:C41 in Email Data sheet in Table C
i.e. 10 to 22 values should match in corresponding 10 to 22 values in Email Data sheet , if not not any value then 0

B50:B62 will be pasted in B29:B41 in Email Data sheet in Table C
i.e. 10 to 22 values should match in corresponding 10 to 22 values in Email Data sheet , if not not any value then 0

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved