Windows Support Forum

Solved: Excel Macro Copy Data From Columns

Q: Solved: Excel Macro Copy Data From Columns

What would be the best way to find a specific Column Header, and copy the data found in the column until the column header is found again?

Relevancy 100%
Preferred Solution: Solved: Excel Macro Copy Data From Columns

I recommend downloading and running Reimage. It's a computer repair tool that has been proven to identify and fix many Windows problems with a high level of success.

I've used it in the past to identify and fix everything from blue screens (BSOD's), ActiveX errors, corrupt files and processes, dll/exe/sys errors, recover lost memory, Windows update problems, defragging, malware removal etc.

You can download it direct from this link (This link will automatically start a download of Reimage that you can save to your computer.)

Relevancy 82.46%

I'm a novice excel VBA macro user. I've manipulated already created macros, but I'm not sure how to create one from scratch. Can someone please help me create a macro.

I'd like to move the values highlighted in yellow to the cells highlighted in green...and then delete any rows that are empty.

Thanks in advance for the help.

Relevancy 105.78%

I have searched for a similar issue but was unsuccessful I need to create a macro to do what will surely one cells to from macro Excel 2007 to copy columns row in files certain second be a miserably repetitive job of transposing data for a whle bunch of files I need to get into each excel file and copy certain data fields from column B B -B turquoise B -B Excel macro to copy certain cells from one row to second files columns in 2007 bright greeen B -B bklue B -B pink and B tan into sequential cells in another file into a single row under a heading A - O I will need to do this several hundred times open a file copy the fields and all the files selected data from a column will wind up in a single excel data sheet in columns I thought I would just do a careful record macro but cannot get to record beyond my first cell copy I have named both files xlsm and changed settings to no avail The source file is Excel macro to copy certain cells from one row to second files columns in 2007 attached and called Source and Detsination is called destination Any help or a macro would be greatly appreciated attached the source file Source I collor codes the field to be copied in the source Excel macro to copy certain cells from one row to second files columns in 2007 as indicated aboue with the header fields in the destination if that helps Thank you VERY much nbsp
Relevancy 105.78%

Hi Gurus,

I have many excel files containing similar data.

1. I want to copy specific columns (columns A to U) from all files and paste the consolidated data into another excel file.

2. I also want to copy specific columns (columns C,D,E,G,H,K,L,T,V,W,X,Y) and paste the consolidated data in a different excel.

Please help.

A:Excel macro - copy specific columns from different files to one file

Are all of these source Excel files stored in the same directory? Do they need to be opened and consolidated in any particular order? More details please. If possible please try to provide a sample file with any sensitive data removed.

Relevancy 101.91%

Hello my fellow databasers The Information I am currently working for a company that is tracking their part s expenses per each customer job All customers expenses are entered into the same primary workbook so entering information is easier than going to each customer workbook The column headings are as follows Customer Name - Date - Part Used - Cost - Invoice - Additional Notes There is primary workbook and then each customer has their own workbook I have researched for a week now and am not savvy enough with Excel to know exactly what I should search for I believe a macro is what I want though The question How or what would I do to have each workbook search for its copy substitute workbooks to or Solved: 2010: Excel Macro automatically between data relative Customer Name and paste auto populate the information into the workbooks ex I entered a part for John Solved: Excel 2010: Macro or substitute to automatically copy data between workbooks Doe within Primary Workbook The second workbook sees John Doe copies the row of all parts that have John Doe in the first column and populates it in the second workbook Also would I need to create a Solved: Excel 2010: Macro or substitute to automatically copy data between workbooks separate Vlookup Solved: Excel 2010: Macro or substitute to automatically copy data between workbooks first to add a value to my customers so it wasn t text based to help the above equation work I know I could copy and paste each one but sometimes we retroactively change values of costs and for the amount of time I could save by creating a macro or some formula would be well worth continued research Any help is appreciated Application It s important for my employer to be able to see what parts were used on each job when settling up with clients It will make his life and mine easier if I can get this function to work Otherwise we are looking through hundreds of lines of parts using the find command Thank you for all help and comments nbsp

A:Solved: Excel 2010: Macro or substitute to automatically copy data between workbooks

A macro can do what you need but have you considered using filters on the primary workbook where you can select the customer name and only those records will be displayed? This will eliminate the need for multiple workbooks and make your life much simpler. An added benefit would be the ability to filter on other criteria like Date Or Part # so you can see across Customers what occurred on a specific date or which customers ordered a specific part.
Alternatively, this would be an ideal application for Access which would make data entry simpler and provide the information you need in the format you need.
Relevancy 100.62%

I need a visual basic macro for excel that will do the following From sheet ColumnA Select rows until sheet columnA value does not start with REC as the no of rows is unbalanced sometimes rows sometimes rows sometimes rows etc copy selected rows and transpose to sheet columnA to however many rows were selected Repeat until end for 2002 to in new Visual columns Excel data unbalanced Basic rows sheet using Macro last row My real table has rows and the rows are unbalanced I am attaching a test file Please help me and thank you for your support and time Tech Support Guy System Info Utility Visual Basic Macro for Excel 2002 columns to rows in new sheet using unbalanced data version OS Version Microsoft Windows XP Professional Service Pack bit Processor Pentium R Dual-Core CPU E GHz x Family Model Stepping Processor Count RAM Mb Graphics Card ATI Radeon HD Series Mb Hard Drives F Total - MB Free - MB G Total - MB Free - MB H Total - MB Free - MB Motherboard MICRO-STAR INTERNATIONAL CO LTD G M -L V MS- Antivirus None nbsp

A:Visual Basic Macro for Excel 2002 columns to rows in new sheet using unbalanced data

Can you also attach a second workbook showing how the data should appear after the macro is run?

Relevancy 95.89%

I need assistance with creating a macro. I need to create a lot of different reports but I want the macro to create them for me. Is there way to create a macro by: having a list of data, sorting it all by column A, then copying whatever is the same name in column A (and whatever is associate with column A- to the right) and inserting it into a new worksheet and then doing it for all the different data that is in column A. Then once it is put into the worksheet, to save it with whatever the name is from Column A in the first worksheet.

I figured that there needs to be a loop statement in the end so it will get all the grouped data together into seperate worksheets.

Thanks for your help. I have attached a spreahsheet to get a better idea of what I was looking for.

Relevancy 94.6%


I'm looking to set up a macro to do the following:

Open up a workbook called Works Order Register
Find my Works Order on the register by matching the WOnumber (I8) and Contractor name (C1735) from Works Order workbook.
Once found copy various data e.g cell I1735, I1737 etc across to columns D, E etc on the register against the corresponding row found in the previous step.

I've got parts working ok, but not the whole thing together.

Thanks for help.

Relevancy 94.6%


I have data in the following row format:

0 4591 5 4491 10 4461 15 4441 20 4321

The data are X and Z points so the above example shows 5 pairs of data. I would like to place these pairs of data sequentially in two columns where one column has all the X's and the other has the related Z's. I have many, many rows of similar data that I need transferred into two columns.

0 4591
5 4491
10 4461
15 4441
20 4321

Could anyone help me out with a macro that can do this for me?

Thanks very much in advance.

A:Solved: Excel Macro - Rows to Columns

Welcome to the board.

Let's say the example pairs are in A1:J1.

With A1:J1 selected,

Sub test()
For Each Cell In Selection
If Cell.Column Mod 2 = 1 Then
Range("A" & Rows.Count).End(xlUp).Offset(1) = Cell.Value
Range("B" & Rows.Count).End(xlUp).Offset(1) = Cell.Value
End If
Next Cell
End Sub

gives you actual pairs in A2:B6.

So, what do we need to adjust to make it compatible with your "many, many rows of similar data" scenario?
Relevancy 93.74%

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.

A:Excel Macro to copy user selected data to new workbook

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.
Relevancy 93.74%

I have a flat file that when I read it into excel it populates column 1 of each row with data.
This data is actually a series of 5 fields that I need to have in columns and rows, that is,
column a1 thru a5 I need placed in a1, b1,c1,d1 and e1 followed by
column a6 thru a10 placed in a2,b2,c2,d2 and e2.
The data is balanced, that ism there is data in each of the 5 fields for a "record".
Any help would be appreciated.

Relevancy 93.74%

I'm using some software to export payment information into a CSV file. This file needs to be in the bank's specified SIF format which requires all the data to be in one column.

The limitation with my software is that the detail of each payment gets exported into it's own separate column. For instance, cells A1:A10 contain payment details to one individual, B1:B10 to another, and so on. I require the whole lot combining into Column A, running from A1:A65536 (it will never go this far down the spreadsheet, but you get the idea).

I've tinkered with some basic copy and delete macros but I'm unable to make the headway that I need to. I don't have the touch when it comes to programming .

Thanks in advance

Relevancy 91.59%

I need to delete multiple columns within an Excel worksheet based on the headers in the first row. What would be the best way to perform this operation?

I have been playing around with the code below, but I feel as though there could be a better way.

Sub test()

Dim myArr As Variant

myArr = Array("Test1", "Test2", "Test3")
If Range("C1").Value = myArr Then
Columns("C").Delete shift:=xlToLeft
ElseIf Range("D1").Value = myArr Then
Columns("D").Delete shift:=xlToLeft
End If

End Sub

A:Solved: Excel Macro -> Delete Multiple Columns Based on Criteria
Relevancy 90.73%

I am trying to write some vba code to Copy the the contents from each row in excel and make it into a new text file. I need the 1st Row to be in each text file though. So the 1st loop would be A1 & A2 row copy next loop would be A1 & A3 copy. When i paste the values in the new sheet to be saved as the text file I need to transpose the paste so row 1 now will be in column A. The filename would be created from the value in Column A. I have uploaded some example files. Any help would be greatly appreciated. The bonus would be if i could get any empty spaces removed from the cells.

I tried modifying some code that Jimmy the Hand wrote linked here
with no luck.

Relevancy 89.87%

I started out with the two previous posts about macros (post 1, post 2) that move rows into columns, but I'm having a little trouble getting it to work for what I need. First, I'm trying to do a data merge into Word, but in order to get the data merge to work/look the way I want it to, I need the XLS data to be in columns.

I'm attaching an example file that has one worksheet of the sample data (though my "real" data has about 300 rows) and the other worksheet is an example of the outcome I need.

Is there anyway I can do what I need? Exporting into another file or another worksheet within this file would be fine.

Thanks in advance.

A:XLS Macro to move data to columns, delete empty rows, delete duplicate columns
Relevancy 89.87%

Hello I ve long used a simple macro on various spreadsheets to reset the last used cell Sub Reset Range Application ActiveSheet UsedRange End then Excel 2003 range reset to & delete columns rows, macro Solved: blank Sub This works fine but prior to using it I would have to press CTRL End to see where the current last cell is then manually delete any blank columns and rows appearing at the end of the data by selecting them by their column letters row numbers right clicking and selecting Delete Failure to do this would mean the macro didn t successfully correct the last used cell I would like to add this stage into the Solved: Excel 2003 macro to delete blank columns & rows, then reset range macro I found some code on the web that allegedly removes all blank rows and columns so I pasted it at the top of my existing macro Option Explicit Sub DeleteBlankRows Dim Rw As Solved: Excel 2003 macro to delete blank columns & rows, then reset range Long RwCnt As Long Rng As Range Application ScreenUpdating False Application Calculation xlCalculationManual On Error GoTo Exits If Selection Rows count gt Then Set Rng Selection Else Set Rng Range Rows Rows Solved: Excel 2003 macro to delete blank columns & rows, then reset range ActiveSheet Cells SpecialCells xlCellTypeLastCell Row End If RwCnt For Rw Rng Rows count To Step - If Application WorksheetFunction CountA Rng Rows Rw EntireRow Then Rng Rows Rw EntireRow Delete RwCnt RwCnt End If Next Rw Exits Application ScreenUpdating True Application Calculation xlCalculationAutomatic End Sub Sub DeleteBlankColumns Dim Col As Long ColCnt As Long Rng As Range Application ScreenUpdating False Application Calculation xlCalculationManual On Error GoTo Exits If Selection Columns count gt Then Set Rng Selection Else Set Rng Range Columns Columns ActiveSheet Cells SpecialCells xlCellTypeLastCell Column End If ColCnt For Col Rng Columns count To Step - If Application WorksheetFunction CountA Rng Columns Col EntireColumn Then Rng Columns Col EntireColumn Delete ColCnt ColCnt End If Next Col Exits Application ScreenUpdating True Application Calculation xlCalculationAutomatic End Sub However it doesn t work with my current document - pressing CTRL END after running the combined macro takes you to the same last cell as if you hadn t run it Cells in the blank columns and rows at the end have formatting shading cell borders but no obvious data As a test I also tried deleting the contents of column in the middle of the data selecting column and pressing Delete just leaving the cell formatting in place The macro failed to remove that column too So can someone help me get code that actually works in deleting empty columns and rows and resetting the last used cell Ta nbsp

A:Solved: Excel 2003 macro to delete blank columns & rows, then reset range
Relevancy 88.58%


First, thank you all for you time and knowledge in advance.

Here's my situation. I'm working with file that is sent to me with populated information, in this example Col A
What I would like to do is enter information in Col B and then do a comparison of both A and B, letting me know if something in Col B is not in Col A and also is something in Col A not in Col B.

I need to know if what was sent to my in the spread sheet match what I physically inventoried.

I have provided an example.

Hopefully I did not over complicate my request.

Thank you,


A:Solved: comparing data in two columns in Excel

does this help

or this may ble closer to what you need
Relevancy 88.58%

I have data organised in paris of columns with differing amounts of data in each column pair.
I need to move all data to columns A&B:

- If there is data in columns C & D, move it to the foot of columns A&B.
- Then, if there is data in columns E & F, move it to the foot of columns A&B.
- Etc. til the end of the ActiveRange.

I've managed to do this using hard-coded column references, but it involves a lot of reptetition.
Presumably the code can be substantially compacted, and work to the end of the ActiveRange rather than to arbitrary end columns (in this case, cols AC and AD).

A:Solved: Excel VBA moving all data to columns A+B

This will work on the active sheet.... If you need this for multiple sheets we would need to alter the macro slightly. Test this on a copy of your xl file.


Sub appAB()

Dim i As Integer
Dim lRow As Integer
Dim lRowA As Integer

For i = 3 To 30 Step 2
lRow = Cells(Rows.Count, i).End(xlUp).Row
lRowA = Cells(Rows.Count, 1).End(xlUp).Row + 1
Range(Cells(1, i), Cells(lRow, i + 1)).Cut Destination:=Range("A" & lRowA)

End Sub
Relevancy 88.58%

On the attached spreadsheet, I need a total count of baselined desktops (minus the ones that have been deleted) problem is how do I get it to look at one record, mark that that agent had been a baselined one, but is now deleted, so don't count it. I can't just remove the deleted ones, cause I want my customer to know which agents have disappeared. Take a look at the formula in B2 for a general idea. That formula doesn't work cause it just adds everything together. I need it to be smart enough to Total the Baselined Agents and then Subtract the agents that are baselined and deleted per field. Any questions let me know. Look at B2 to get an idea and see if I'm on the right track.

A:Solved: Excel - Trying to count 2 columns (almost as one) to get data for a 3rd.
Relevancy 88.58%

Hi - I m semi-proficient with excel and I m actually working on creating some dashboard reports at this time One problem I m having is separating some of the data from a specific column Let me give you an example This column has over lines in Excel columns? separation Data Solved: this is just a sample What I need to do is break this column out by month and show how many dates are from the last month the last - months and the Solved: Data separation in Excel columns? ones that are months in the past Of course I want the sheet to show this info automatically so it has to know the current date which I can do by placing the formula quot TODAY Solved: Data separation in Excel columns? quot So what I m asking for is what formula and format would I use to count how many cells in this column fall into each of date ranges I mentioned Also I did manage to use the DAYS A C for example where A quot Today quot and C quot quot above This information is in cells next to the above data as follows - - - - - - - - - - - - - - - - So I figured out how to list how many days I have since the date Solved: Data separation in Excel columns? in the first column but not how to break them apart within the column Hopefully this is enough information to request some help but if you need more info please let me know I ll watch the thread closely Thank you -Drake nbsp

Relevancy 87.72%

Hi This is a fab site just spent a good few hours reading through without realising the time ANyway I am stuck on an Excel problem I have two columns of which there are lots of duplicates in column A and various values in column B Like this A B Book Title Song One Book Title Song Two Book Title Song THree Book Title Song One Book TItle Song Two Book Title Song Three Book TItle Song Four and so on for rows Merge two Solved: a Data Columns from row Sort Excel and into What I would like to do is have all of the relevant info from column B in just one cell in one row rather than a separate row for each song title So what I ideally need is A B Book Title One Song One Song Two Song Three Book Title Two Song One Song Two Song Three Song Four and so Solved: Excel Sort and Merge Data from two Columns into a row on Solved: Excel Sort and Merge Data from two Columns into a row I have no idea where to begin with this I have read several similar Solved: Excel Sort and Merge Data from two Columns into a row things that might help but the problem is that each Book Title has a different number of songs in it Can any one advise a complete beginner on how I might accomplish this Many thanks for any guidance nbsp

Relevancy 86.86%

Hello I have two problems I have a lot of scanning data all date and time stamped All the scans show different status of shipped packages all shipments have unique ID but there are multiple scans data export from macro to second Solved: excel ACCESS: and Show latest data on route for all Solved: ACCESS: Show second latest data and export data to excel from macro of them to track the packages I want to find all the packages for which there was quot misdirected quot scan then for all of them show the scan before So the end result would be all the scans that show for each package where it was misdirected the terminal of the scan before the misdirect scan I want to automate this run queries every two hours between am and pm copy and paste all results into Excel to specified areas e g first query results to A second to A third to A etc or onto different tabs save as csv to a specific folder then send it as attachment to a given e-mail address Even partial solution can be good I only know macros somewhat not as much VBA so I tried that with the TransferSpreadsheet command but can t get it work Any help is greatly appreciated nbsp

A:Solved: ACCESS: Show second latest data and export data to excel from macro
Relevancy 86.86%

When i export my inventory from my DB into an excel file my trailer brands are listed as they are in my DB of course But when i bulk upload them with XML feed to trailer inventory sites HTW com amp HTT com for our example here My inventory is listed on their site but it s not searchable because the brand search is a Replace with similar - sample data required Solved: Formula? Excel my data or -Macro drop down Solved: Excel -Macro or Formula? Replace my data with similar required data - sample menu on these sites Say i goto HTW com and do a search for Blue Ribbon trailers none of my blue ribbon trailers show up because all of Solved: Excel -Macro or Formula? Replace my data with similar required data - sample mine are listed as BLUE RIBBON TRAILERS LTD and the site is searching for Blue Ribbon and although they are the same trailer brand HTW com does not see them What i m looking for is maybe a Macro or even formula that once i tell it what site i m working on will go through my list and replace all my spellings with the proper ones for that site Attached is an XLS file with columns the first is my list as is from my DB the other columns are the proper spelling for each corresponding site Excel s find and replace feature is a VERY crude fix to this but since it s so time consuming it s NOT a viable solution Any takers Slurpee Zack Anyone nbsp

A:Solved: Excel -Macro or Formula? Replace my data with similar required data - sample

for the record, a complete solution would be GREAT, but not necessary...
I just need someone to point me in the right direction and maybe a small working sample of like 5 brands and i'll expand the list from there...

Relevancy 86.43%

Hello again,

I have a word doc that has a form in it. The form may have any number of fields (boxes) to type text answers into, or be a drop down list to select an answer from. I need an excel macro that extracts all data from the form, but with every five fields starting a new row in excel. So all data from the form will appear within 5 columns in an excel spreadsheet.

field 1 field 2 field 3 field 4 field 5
field 6 field 7 field 8 field 9 field 10

Is that possible? I have had no luck to do it myself.

Sample form attached, thank you

Relevancy 85.14%

I am trying to come up with a macro that once executed will go to a defined name, insert a row, copy what is in row one and then paste the copy in the row that was just inserted.

Relevancy 84.71%

I am trying to do a macro to multiply the several columns values, observing determined terms, but do not be getting. Attachment, worksheet with example and for macro that I typed but is not solving. I thank any help.

Relevancy 84.71%

I was hoping someone could help me write or find a macro that would take two columns and move it to column A under the previous data and repeat for all columns. Basically user information is located in pairs of columns (typeofvalue, value). So column A and B are for user1, column C and D are user2, column E and F are user3, etc. Bonus if I could have a space in between each once moved.


HTML Code:
User1First User1Last User2First User2Last
User1ValueTypeA1 User1ValueB1 User2ValueTypeA1 User2ValueB1
User1ValueTypeA2 User1ValueB2 User2ValueTypeA1 User2ValueB1

HTML Code:
User1First User1Last
User1ValueTypeA1 User1ValueB1
User1ValueTypeA2 User1ValueB2


User2First User2Last
User2ValueTypeA1 User2ValueB1
User2ValueTypeA1 User2ValueB1
Each user has 47 rows of "values", for the example I just did two rows worth.

A:Excel Macro to move columns to 1 row after each other.

I did a quick google and found this. It worked for you?

Excel macro to move columns to 1 row after each other
Relevancy 84.71%

I am very new to writing macros and I'm trying to find a macro that will search for a key word within the whole spreadsheet. If the keyword is found in say 7 of the rows, those rows will remain and all others will be hidden (except for the first 4 rows as these have headings, etc.).I would be very grateful to anyone who can point me in the right direction!message edited by Adrian82

A:Excel Macro - Keep only columns with key words in them

I do not have access to Excel or VBA at the present time, so the best I can offer at this point is to suggest that you look up the VBA Find method via Google. You'll find various options for the use of Find and FindNext. Those are the methods that I would use to loop through your sheet, searching for the key word.If I were to write code to do this, I would start by hiding all Rows (except for the rows with the headings) and then unhiding the rows where the key words were found. That way is easier than hiding rows which don't contain the keyword. Finding something with VBA and unhiding the row where it was found is much easier than not finding something and then hiding the row where it wasn't found.Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.
Relevancy 84.71%

I am trying to create a macro in Excel that will sum two different columns of numbers The columns will always 2 Macro Sum 2007 Columns Excel be the same length I am new at quot trying quot to create macros and I can t figure out how to keep the same range to sum just move it columns to the right A sample of the table data is below Thank You Sub Test On Error GoTo CancelExit With Selection Offset Rows Count Columns Count Excel 2007 Macro Sum 2 Columns Cells FormulaR C quot SUM quot amp Address xlR C amp quot quot Offset Rows Count Columns Count Cells FormulaR C quot SUM quot amp Address xlR C amp quot quot End With CancelExit On Error GoTo End Sub I am trying to create a macro in Excel that will sum two different columns of numbers The columns will always be the same length I am new at quot trying quot to create macros and I can t figure out how to keep the same range to sum just move it columns to the right A sample of the table data is below Thank You Sub Test On Error GoTo CancelExit With Selection Offset Rows Count Columns Count Cells FormulaR C quot SUM quot amp Address xlR C amp quot quot Offset Rows Count Columns Count Cells FormulaR C quot SUM quot amp Address xlR C amp quot quot End With CancelExit On Error GoTo End Sub Sale Date Sale Price Adj Sale Price Land Imp Total I would be summing the Adj Sale Price and the Total everytime There is data above and below each quot mini-table quot and all are of different rows I tried to set it up to highlight the first column series as all the rows in that series will alway be the same number of rows All help is greatly appreciated nbsp

Relevancy 84.28%


I know nothing about programing an excel Macro but I need help createing a macro to do the following:

file 1
col a ffffcol b
1 ffffffffff48
2ffffffffff 26
3ffffffffff 53
4 ffffffffff8

File 2
col c fffffcol d

I want to fill the rows in col d in such a way that 1 coresdponds to 48 and so forth.

Also, the file has over 7000 rows of information so doing it by hand is not a viable option

Relevancy 84.28%

Good morning I consider myself a novice when it comes to Macros I have Insert & Excel Copy Solved: Macro - written several simple macros using the macro recorder and VBA My current dilemma is I have a template worksheet in which I wish to copy a range of rows several times within the same worksheet with a blank row between each copied range The number of copies is dependent on the number of rows Solved: Copy & Insert Macro - Excel of data cost centers within Solved: Copy & Insert Macro - Excel worksheet I have seen some macro language that should accomplish the copy range however the next step is what throws me For each copy of the template range I d like to insert the data cost center that comprises the rows on worksheet Essentially I want to create a copy of the template range for every cost center listed on worksheet See the attached example Once the copies are made and the cost centers are inserted my database will refresh the worksheet and bring forth the data for each cost center Macro language is not needed for the last step Thanks in advance for your assistance Please let me know if the inquiry is not clear at any point nbsp

Relevancy 84.28%


I'm really new to writing code and I'm trying to develop some stuff in Excel 2007.

I want to record a macro for a command button that when clicked, will copy the data from Cell A6, and past it with formatting and everything into whatever cell I selected.

I can get it to copy and paste, but only into a certain cell.

Help required!



A:Solved: Excel Copy and Paste Macro

MacShand, welcome to the forum.

Try This:

ActiveCell.PasteSpecial Paste:=xlPasteAll
Application.CutCopyMode = False

What the code does is it copies the contents in cell A6 to whatever cell you have selected at the present time. So, make sure before you run the code the correct cell is selected or you may copy over needed data.
Relevancy 84.28%


I am trying to classify and code my inventory items in excel.
My classification sheet contains data in columns which I would like to copy to rows in another excel sheet.
Here is the sample data in ACMOTORS-ATTRIBUTES sheet:

The above sheet has to be converted to columns as in Item_Classificatios_Form sheet :

Can anybody assist me in writing a macro for the same.


A:Solved: Excel Macro to convert Rows from one sheet to columns in another sheet
Relevancy 83.85%

Hi all,

I have a requirement. Consider there is an excel sheet with values in several columns. Some of the columns inbetween are empty. So i have to somehow highlight the empty columns.
Note: All the columns have headings in the first row.
It is ok even to get the headings of the empty columns in seperate sheet.
Help me out guys.

Thanks in Advance,

A:How to find Empty columns in Excel using Macro

will conditional format workto highlight blank cells if so

goto conditional format- click on cell A1 and then hightlight the range - if you want all the spreadsheet - click on the box between the columns and rows
then in conditional format

then set a format fill colour

heres a macro to remvoe blank columns
but may not work if you have a heading - as thats not a blank column

if you could load a dummy spreadsheet as an example- others here with more macro experience should be able to help
Relevancy 83.85%

I have a dump from a text file in two single columns. The first column is a block of 55 labels that repeat for every group of data, the second is the data for 110 transducers. Every transducer produce 55 single values (numerical or status(text)). I need to order this two columns dumps into a table. Where the first column are the labels and the rest 110 column the corresponding data one column per transducer.
How can we do this? Can any body help me?

A:Excel macro to move two Columns into a table

Hi and welcome to TSG!

Can you upload a sample of the textfile? I just need a few lines. It doesn't have to be real data. Just want to see the data structure.If you can provide this, I'm sure we will solve the problem.

Relevancy 83.42%

Excel 2003 SP3
Could anybody suggest a way, using whatever method you prefer to copy existing data to another tab, but have the data go transparent by 50%(or thereabouts, so you can just see it), but keep the headings normal font.

A:Solved: Excel 2003 help to copy data to new tab and make data transparent
Relevancy 83.42%

I need to create a macro in Excel that will look for a certain text within a column (Column A), Copy the data in another column (Column B), and paste the data in another column (Column C).

For Example....

Column A

Column B

So, I would like to copy all the data in Column B that correspond with "ABC1" in column A, and paste that data in Column C.

Relevancy 83.42%

Hey all Here s my situation any help is greatly appreciated I have a list of items in one column A couple of the cells will be hidden by the macro but then what I need the macro to do is copy the first unhidden number cells Solved: of Copy a certain Excel macro: items onto the clipboard What row s will be hidden will vary from week-to-week Solved: Excel macro: Copy a certain number of cells If I were to simply have the macro copy a cell range there would be a chance of it copying a hidden cell I believe what I need is a way to have the macro do a count of how many unhidden cells it has selected and stop when it reaches Forgive my ignorance but I am literally just picking up Visual Basic as of this week EDIT Just to clarify I have the hiding of Solved: Excel macro: Copy a certain number of cells the cells taken care of I just need some help figuring how to copy the top cells that aren t hidden EDIT Solved: Excel macro: Copy a certain number of cells Found that I could delete the hidden cells Worked perfectly nbsp
Relevancy 83.42%

I have been reading up on creating log files with Excel Macros.

I am trying to figure out if it is possible to have a Macro output the contents of the currently selected Cell to a text file?

Relevancy 83.42%

Hi. I am trying to run a macro to copy items on 1 sheet and have it paste them on the 2nd and 3rd sheet. I am trying but can't quite seem to get the excel code to do what I want. I can't post a copy of it because I accidentally deleted it.

Can anyone help me?

Relevancy 82.99%

Hello - I found a previous post on this site that solves (I think) 90% of what I need to accomplish. I have a large spreadsheet that I need to:

Delete column C
Delete all rows without account numbers (Acct numbers will always be in column A)
Delete all rows that have dates in column F other than “00/00/0000”.

The code I found on this site is :

Simple vba code:
lastrow = Range( "A65536").end(xlup).row
For y = LastRow To 2 Step -1
If Cells(y, x).Value = "" Then Cells(y, x).Delete shift:=xlUp
Next y
Set the range to the the column desired, in this case "A"
Lastrow checks the last row and starts from the end up.
Removes all empty rows entirely up to row 2 because row 1 generally is the header
Happy coding
Can anyone help me?

A:Excel VBA Macro to delete rows/columns with criteria

To delete column c, use:
Delete all rows without account numbers (Acct numbers will always be in column A)
If Cells(y, "A").Value = "" Then Cells(y, "A").Delete shift:=xlUp

lastrow = cells(rows.count,1).end(xlup).row
For y = LastRow To 2 Step -1
If Cells(y, "A").Value = "" Then Rows(y).EntireRow.Delete
If Cells(y, "F").Value = 00/00/0000 Then Rows(y).EntireRow.Delete ' Delete all rows that have dates in column F other than 00/00/0000.
Next y
Relevancy 82.99%

I am trying to write a macro that compares cells in column A from sheet1 to cells from column A in sheet2 and if the values from sheet2 are not in sheet1 then I want to delete the entire row from Column A in sheet2.

for example

In sheet1, column A has a list of id no's (no duplicates) and in sheet2 Column A has list of id no's (with duplicates). I want to delete every row in Sheet2 Column A that is not in Sheet1 Column A.

Keep in mind that both sheets have several columns.
Also there is about 5000 rows in sheet 2

Any help would be greatly appreciated.


A:Excel HELP macro to Delete Row Based 2 columns from 2 sheets

Welcome to the board.

While I understand each part of your post (I think), some parts seem to contradict others. So here's what I did.

In Sheet1!A1:A5 I entered 1 -- 2 -- 3 -- 4 -- 5.

In Sheet1!A1:A6 I entered 1 -- 2 -- 6 -- 3 -- 4 -- 5.

Then I wrote some code that removes the third row from Sheet2, since it contains 6 in column A which is not in col A of Sheet1.

How the code works is:

(i) inserts a new column A on Sheet2

(ii) enters a formula in new column A Sheet2, e.g.:


which returns a number if there's a match in column A Sheet1, #N/A if not

(iii) deletes any rows on Sheet2 with #N/A in column A

(iv) deletes column A on Sheet2 (redundant).

Obviously if this isn't what you need don't use it, post more info instead.


Sub test()
x = Rows.Count
y = Sheets("Sheet2").Range("B" & x).End(xlUp).Row
Sheets("Sheet2").Range("A1").Resize.FormulaR1C1 = "=MATCH(RC[1],Sheet1!C,0)"
Sheets("Sheet2").Range("A1").Resize.SpecialCells(xlCellTypeFormulas, 16).EntireRow.Delete
End Sub
Relevancy 82.99%

Hi, I'm new to macro. Hope you can help me with my problem. I've been stuck with this for a week with no result.

I have this table:

001 002 003 004
111 115 119 123
112 116 120 124
113 117 121 125

Let's say, the first row are the StoreID and all other digits below them are the ProductID

I want to convert this table into something like this:
001 111
001 112
001 113
002 115
002 116
002 117
003 119
003 120
003 121
004 123
004 124
004 125

I haven't made any macro before in MS Excel and this one is really getting the breath out of me.

Hope you can help me please.. I'd really appreciate it.

Thank you in advance!

A:Help with Macro in excel - Convert Rows to Repeating Columns

is this just a "one off" thing or do you have many sheets to convert? Because for one or a few sheets, it is not a lot of work to do manually...probably take a few minutes ( I 'll explain if you need)

to automate I can do it, but I need to build some loops and references to refer to the columns and ranges to move to a new's a bit of work.

Please confirm also if it is only 4 columns, and or if the column count varies
Relevancy 82.99%

Hello - I found a previous post on this site that solves (I think) 90% of what I need to accomplish. I have a large spreadsheet that I need to:

Delete column C
Delete all rows without account numbers (Acct numbers will always be in column A)
Delete all rows that have dates in column F other than 00/00/0000.

The code I found on this site is :

Simple vba code:
lastrow = Range( "A65536").end(xlup).row
For y = LastRow To 2 Step -1
If Cells(y, x).Value = "" Then Cells(y, x).Delete shift:=xlUp
Next y
Set the range to the the column desired, in this case "A"
Lastrow checks the last row and starts from the end up.
Removes all empty rows entirely up to row 2 because row 1 generally is the header
Happy coding
Can anyone help me?

A:Excel 07 MACRO to delete rows/columns w/ criteria

Delete all rows without account numbers (Acct numbers will always be in column A)Click to expand...

If there are no acct numbers, will there be

blanks ""
Space " "
dash -
other ??
Can you provide a sample with dummy data so we can see the data structure?
Relevancy 82.13%

quot Macro Creation Request for Moving Data from Rows to Columns in a Non-Conventional Way quot Hello all Hopefully somebody can help me with the following problem please see the attached document Presently I have an Excel document containing variables - per country in rows for label through label x However I need the table to contain the country level information as Columns Way Data Request Rows Moving for in from Macro Non-Conventional Creation a to columns Macro Creation Request for Moving Data from Rows to Columns in a Non-Conventional Way for each label so that there is only one row per label For example instead of row containing label argentina variables - then row containing label arab emirates variables - I need the table to contain row label columns argentina variable argentina variable etc then arab emirates variables arab emirates variable etc Also the countries in the table that do not have information for a given label fall at the end of the list for each label instead of in alphabetical order Macro Creation Request for Moving Data from Rows to Columns in a Non-Conventional Way but they need to be placed in Macro Creation Request for Moving Data from Rows to Columns in a Non-Conventional Way alphabetical order when quot columnized quot I have provided the arab emirates as an example Alphabetically it comes before Argentina but in the list it comes after because it did not contain information for those given labels Since information per country will vary from label to label the countries must remain in alphabetical order in the columns regardless of whether information is provided or not per label Is there a macro that may be written for this Thank you so much in advance for taking the time to read my post Happy day nbsp

A:Macro Creation Request for Moving Data from Rows to Columns in a Non-Conventional Way
Relevancy 81.7%

Hello Everyone First time user of Paste Macro of Search Values, and Copy, Solved: - List Excel the forum here and it does seem everyone is very helpful I did a search and could not find search macro for a list of values so I m adding a new post My apologies if this was answered before but hopefully someone Solved: Excel Macro - Search List of Values, Copy, and Paste can point Solved: Excel Macro - Search List of Values, Copy, and Paste me in the right direction Here s what I have I have worksheets List of Search Criteria List of or so countries in column Solved: Excel Macro - Search List of Values, Copy, and Paste A Huge Data Set Sales Data column K L or M will contain country name Blank Output sheet My goal is create a search button that will look in the Huge Data Set for sales transactions occuring in the list of countries specified on Sheet The country info could be in any of the rows K L M on Sheet I would then like any row on the Huge Data Set with a matching country to be copied to the rd worksheet I hope my explanation makes sense Any help Simon nbsp

Relevancy 81.7%

I have a spreadsheet that is used by a number of users and has a macro built into it to collect updates from several other sheets. I want to add to the macro so that once it has been updated and saved the macro then saves another version of the sheet in a seperate folder with the date and time it was saved as part of the file name.

I have tried

ChDir"H:\Resourcing Teams\Placements\Weekly activity\Archive"
ActiveWorkbook.SaveAs Filename:= _
"H:\ResourcingTeams\Placements\Weekly activity\Archive\" & Now.Day & Now.Month &Now.Year &" .xlsx", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

But get errors

Any suggestions greatly appreciated

A:Solved: Excel Macro to save a copy of the file in new location with the date
Relevancy 81.27%

Hi I need a help Macro two for from data excel combining Solved: sheets with a macro I have two separate sheets that I need to combine together Sheet contains Solved: Macro for combining data from two excel sheets combinations of PROCESSES e Solved: Macro for combining data from two excel sheets g - and - columns B and C and sheet two contains additional data PRGRAMS for each of the process each program on separate row - the Solved: Macro for combining data from two excel sheets process number linked to sheet is in column A So for process there are programs rows for process there are rows and for there are rows I would like to create a third sheet that combines PROGRAMS from Sheet based of given combinations of PROCESSES from sheet and attaches LHS for the left side of the rule and RHS for the right side of the rule I attached a shortened example I need this for combinations There could be a way in inserting number of rows into sheet e g for the combination - there would be the number of rows added that equales the count of quot quot count of quot quot programs from Sheet and the programs would be pasted I hope its not too complicated Thanks a lot for your help Marketa nbsp

Relevancy 81.27%

I m in a bit of a pickle I have an excel document with a summary page quot Tracker quot This worksheet has a table in it with a whole heap of customer information and at the end there are columns for revenue summaries Every month I run a report that I add in a new worksheet which is called quot Relevant Month Revenue Report quot and then I do a vlookup to transfer the revenue and product information in columns quot C quot and quot D quot of the report into the relevant month columns in the quot Tracker quot This has been working well for me but i ll be handing this role over soon so I to Solved: worksheets one into Macro data transfer Excel several from was wondering if there was a macro that I could use that would do this vlookup automatically for the relevant month The Solved: Excel Macro to transfer data from several worksheets into one information in the reports is not in any particular order so i can t do a simple copy paste into my quot Tracker quot summary Any help would be greatly appreciated nbsp

Relevancy 81.27%


I have a worksheet containing various data including an expiry date, this is created by adding 364 to the start date and then then using an auto fill to fill in all other rows (over 50,000).

I would like to make a macro to do this alongside a number of actions but when making the macro I am specifying only a certain range to fill (A1:A50000). The problem I have is this list is consistently growing and so this range would then not include any new records added. Is there a way that I can make it so it auto fills from A1 to the last present row?

Thanks for your help


Relevancy 81.27%

I have a list of branches. We have a closed branch that I need to have inserted onto this report. There are times that the closed branch shows up becuase they had warranty work to do, but most times it does not show up. This is branch 046.

How do I write a macro to check for the branch and if not there add it in?

To add more to this - each branch should show up in 2 different rows in the same report. So I really need to do this for both Branch 046 and for Net Sales - Branch 046

Branch 045
Branch 046
Branch 047
Branch 049

Net Sales - Branch 041
Net Sales - Branch 045
Net Sales - Branch 046
Net Sales - Branch 047

Relevancy 81.27%

I have found a few posts here and there about how to move columns around but nothing quite what I m looking for.

So I get these data dumps from a vendor weekly , column headers are always the same but they are always in different order (strange I know)


Email | Phone | Last Name | First Name

I would like to have a macro cut/paste entire rows and put in a specific order

First name |Last Name| Phone| Email

Any help would be great! Thank you!

A:Excel 2007 – Macro (newbie) - Move Columns bases on name question

How many total columns are we talking about? Is it possible to post a sample workbook with any sensitive data removed so I can see the structure.

Relevancy 80.84%

I have done a search, and could not find it.

I know there was a post on this earlier but I could not find the post I was looking for.

What I am looking for a macro that will copy specific columns and put them on another worksheet.


With Columns between A and AA
Column F,K,M,Q,S,U,Y would all be copied to Sheet 2

Thanx in advance.

A:Excel - Copy Specific Columns

Can you not just use the macro recorder to accomplish what you want?

Relevancy 80.84%

I am trying to create a macro that will select the text contents of a cell andcopy it into another cell I know recording a macro isn t the best way to go but I m still pretty fresh in coding VBA When I record a macro on the following set of data shown below I cancreate a row above the first row containing quot CASH quot and copy the word quot CASH quot into the cell above it sample data CASH TRES CARD CREDIT HELP SUBTOTAL recorded macro ActiveCell Select Selection EntireRow Insert ActiveCell Offset Range quot A quot Select ActiveCell FormulaR C quot ano it select macro copy cell to content Creating a text into an Solved: Excel and of CASH quot ActiveCell Offset - Range quot A quot Select ActiveSheet Paste If I run the macro on the row containing quot Tres Card quot it willreplace amp TRES CARD amp with quot CASH quot Essentially I am trying the make two rows for each of the existing rows Iwould add quot Solved: Creating an Excel macro to select text content of a cell and copy it into ano quot to the label in column on the first line and add quot quot to that label on the second line The first line would thencontain the data from column B and the second line would contain the data Solved: Creating an Excel macro to select text content of a cell and copy it into ano fromcolumn C So that the end result would look like Example of end result CASH CASH TRES CARD TRES CARD CREDIT CREDIT HELP HELP SUBTOTAL SUBTOTAL If anyone has any suggestions of the best way to do this that I m not thinkingabout or aware of I would appreciate it Otherwise does anyone have any suggestions of how to code the macro toselect and copy the text contents of the cell rather than having it use thetext of the when the macro is recorded nbsp

A:Solved: Creating an Excel macro to select text content of a cell and copy it into ano
Relevancy 80.84%

Hello everyone I am completely stumped and I hope to find some help from someone here I am trying to format an excel spreadsheet that has over k records is a very strange format Please see attachment I have created the logic to grab the numbers to the left of the quot carrot quot in cell E and replicate that number in cells B B B B B B B B That process is replicated to pull the numbers to the left of the quot carrot quot in cell E and replicate that number in cells B B B B B B B B And so on and so fourth The problem I am stumped on is how do i replicate this process all the way down the spreadsheet One FYI is that each record quot bock quot is not always as in the example spreadsheet lines it can be or more lines Basically the record starts at the letters quot MSH quot see A So I the logic I am thinking of is to push the code in red in the quot E quot cells to the quot B quot column after the quot EVN quot in cell A and to stop before the quot MSH quot in cell A and continue that process down the spread sheet I hope this is not too confusing but I have been banging my head on the wall for hours and just cant figure it out Thank you all for your help nbsp

A:Solved: Very hard macro in Excel (copy part of one cell to several areas with logic)
Relevancy 80.84%

Hi all,

I'm having trouble writing a macro that'll help me automate this process. In the attached, I have a list of countries in the Countries tab, and 10 line items in the Data Set tab. I want to look for each of the countries in columns K to M in the Data Set tab, and for each line that hits, I want the macro to copy that line and paste it in the Output Sheet tab. Then the macro should go down the list of countries and repeat this process until it finishes looking for the last country in the Countries tab.

I'm thinking some kind of For loop is required, but any help would be greatly appreciated! Thanks!

A:Solved: Urgent: Excel Macro - Search List of Values, Copy, and Paste
Relevancy 80.41%

Hi everyone,

Let me just start by saying this forum is awesome. Nothing like getting a new perspective to solving a problem!

Here's the scenario:
I have 3 sheets: Input Sheet, Output Sheet, Translation Table

Both the Input Sheet and Output Sheet has columns of data with a header row in row 1. I need to move entire columns of data from the Input Sheet to the Output Sheet based on the header row.

This is where the Translation Table comes into play. I need to move the columns of data based on what is defined in the Translation Table.

For example, all data in column "Column A" of the Input Sheet should be moved to column "Albert Column" of the Output Sheet.

A sample file is attached to better illustrate.

Thanks in advance for the help!


Relevancy 80.41%

Hello I m finally getting near to the end of my mission to get my trading website online but I have one nutty task left to crack with my data and I could do with a bit of help please I have about products graphic novels - I run a comic shop and I have painstakingly put together my related product info in a spreadsheet laid out as in the current layout below For simple I data my of to rejig the excel available require an macro Solved: there Is do most of the Solved: Is there an available macro to do the simple rejig of my excel data I require products there are related products but for Solved: Is there an available macro to do the simple rejig of my excel data I require some there are only or The simply pertains to the order from left to right the related products are shown on the site What I need to do is get them into the required layout shown below so I can just cut and paste them into a specific Access table that already exists in the online trading software However I m struggling with this as my Excel skills don t really go in macros and loops and whatnot I m pretty chuffed with myself when I use something like concatenate I get the impression this should be reasonably straightforward though which is very frustrating Can anyone recommend an available macro or bit of code that does this sort of thing Or am I just missing some very obvious functionality in excel many thanks in advance Jonathan CURRENT LAYOUT this is meant to be columns - Product Reference but it doesn t want to tab nicely Product Reference REQUIRED LAYOUT similarly this is meant to be three columns - Product Reference Related Product Order Product Reference Related Product Order nbsp

A:Solved: Is there an available macro to do the simple rejig of my excel data I require
Relevancy 80.41%

Hi, I need a macro to use in Excel 2003 that will select all data in a column except the header row. At the moment i am using the following command which works well in most cases

ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select

The catch to this is that if the column contains only one row of or no data then the command selects the entire column! Eek, can anybody please help me to fix this?

A:Solved: Excel macro to select data in a column with a header row

Dim lastRow as long
LastRow = worksheetfuntion.Max(2, Range("A" & rows.count).end(Exlup).Row

The variable will contain the last filled row in column A, the Max function will make sure that it will at least be row 2 just in case the column is empty

Then all you need is Range("A2:A" & lastRow).Select
Or if you need more columns then Range("A2:H" & lastRow).select
Relevancy 80.41%

I have an employee list excel file (vacation) including the details about empno, emp name, last vacation, next vacation, etc in sheet 1.
Now, I would like to write a macro where I will enter the name of the month in a dailog box and the macro should display the list as in sheet 2 of the attached file.

Windows 7 with MS Excel 7.

Kindly help me, its urgent.

A:Solved: Excel Macro to display data based on month

I've made a quick macro that does as you requested. It is not "smart" at all so if you change where the data is located (by adding a column for example) it will no longer work. It will handle more rows of data no problem. See the attached.
Relevancy 79.98%


I need help in Excel copying columns and paste it in rows.

Ex: I have Columns A and B.
Column A Column B
5.78% 4.51%
23.60% 32.50%
14.17% 16.41%
32.12% 54.16%

Now output should be in one row.

Row1 5.78% 4.51% 23.60% 32.50% 14.17% 16.41% 32.12% 54.16%

A:Copy columns and paste in rows in Excel

sub test()
dim rng as range
dim i as long
dim col as long
dim nextcol as long
dim lastrow as long
lastrow = range("A"&rows.count).end(xlup)
set rng = range("A2:B"&lastrow)
nextcol =col+1
for i=2 to lastrow
range(cells(i,1),cells(i,col)).copy cells(1,nextcol)
end sub
Relevancy 79.55%

Hoping to get some help on this question please I have reviewed the forum and found a similar post but the sample data is more predictable than mine and the by sort to data then to Macro Excel date, cell Solved: new move Macro posted doesn t work on Solved: Excel Macro to sort data by date, then move to new cell my data See post quot Excel Macro to Move data in Rows to column quot -Aug- AM quot On my data I would like to be able to take the yellow row and move the data up to the previous row starting in column quot R quot The rows I would like on the same line all begin with a date I don t know how to make a looping Macro that will identify the quot date lines quot and take the quot Solved: Excel Macro to sort data by date, then move to new cell second date line quot and move it to the quot first date line s quot row Any help would be appreciated I have attached some sample data I hope that s okay Thank you Christine PS - The range on data varies nbsp

A:Solved: Excel Macro to sort data by date, then move to new cell


this macro below works well with the sample data.
Sub sorting()
Dim Rng As Range, c As Range, i As Long
Set Rng = Range("A:A").SpecialCells(xlCellTypeConstants, xlNumbers)
For Each c In Rng
i = (i + 1) Mod 2
If i = 0 Then
With c.Resize(, 15)
.Copy .Offset(-1, 17)
End With
End If
End Sub

How it works:
1. Takes all those cells in column A of the active sheet that contain numbers. (Dates are actually numbers, only formatted to look like dates.)
2. In a loop, it takes every second cell of the set of cells selected in Step #1.
3. Takes a 15 cells wide region starting with the cell selected in Step #2, and copies it to the region starting with the cell positioned one row up and 17 columns to the right.
4. Deletes the content of the original 15 cells wide region.

1. If there are any numbers in column A besides dates, then the algorithm is wrong and the macro will fail.
2. If the dataset in the second date line is wider than 15 cells wide then the rest will remain in place. But the macro can be easily updated, just change the Resize line.
3. Don't run it twice on the same worksheet.
4. Always make a backup copy of your data before running the macro, because it is not Undo-able.

Relevancy 79.55%

I need to write a macro that Anot Spreadsheet Writing Move Excel for From Help to Data One Macro a Solved: to Need will copy data from one spreadsheet into a separate spreadsheet not Solved: Need Help Writing a Macro for Excel to Move Data From One Spreadsheet to Anot in the same file Here is the scenario On the first spreadsheet I have a customer s name in one column and a customer s address in another column On a separate spreadsheet Solved: Need Help Writing a Macro for Excel to Move Data From One Spreadsheet to Anot a have those same customer s names without the addresses On the second spreadsheet the Solved: Need Help Writing a Macro for Excel to Move Data From One Spreadsheet to Anot customer s name may be listed more than once What I need to do is add the corresponding address to the second spreadsheet beside the name of the customer identical data from both spreadsheets The reason copy and paste won t work is because the customer may appear numerous times on the second spreadsheet and their are approximately rows of data The macro needs to basically say IF Spreadsheet Column A customer equals Spreadsheet Column G customer then ADD REPLACE info from Spreadsheet Column B address to Spreadsheet Column H currently blank I just can t figure out how to make it do that ANY HELP ANYONE CAN GIVE IS APPRECIATED nbsp

A:Solved: Need Help Writing a Macro for Excel to Move Data From One Spreadsheet to Anot
Relevancy 79.55%

I have an issue if certain cells are blank (not sure if they would be null, blank, empty) to have a macro to input "0" in the cell instead. When I look at the format in excel it's under general.

I currently have the following and it puts nothing in the cell. (or seems to be nothing in the cell) I can manually enter a "0"(zero) in the cell and it shows.....

Sub Addifblank49()
Var = Selection.Value
If IsNull(Range("C16").Select) Then Var = "0"
End Sub
I've tried using val instead of var and it won't let me. I'm not real familiar with VBA so any help would be awesome!!

Relevancy 79.55%

I have been working on a project for a few weeks and I could really use some help I m attaching a dummy file example that is an example of how my XLS comes to me each month I need a Solved: to delete specific XLS Macro move to columns rows/columns rows. and macro that leaves me with the second file example If the macro could just grab the Student name then put the following info for each student all on row that would be perfect Child s Name Date In Time In Rounded Time Out Rounded Sometimes for some reason there is a student with Solved: XLS Macro to delete specific rows/columns and move columns to rows. a Cont after their name I need that row deleted and just pull the times up onto the same row as other times The example file might make sense Here are the steps I am doing manually that I hope a macro could do for Solved: XLS Macro to delete specific rows/columns and move columns to rows. me Un-merge cells B Un-merge any cells with a child s name such as Doe Jane Delete any row with a childs name that has Cont after it such as Doe Jane Cont Delete rows - Delete columns A C F H I J M N O and P Manually move all info up to one row per student Delete all empty rows below See example as the completed file but I only moved a few of the rows per student for the sake of time Is there any way to do all of this with a macro nbsp

A:Solved: XLS Macro to delete specific rows/columns and move columns to rows.
Relevancy 78.69%

Is it possible to fetch some lines of data from a group of web pages and paste in to Excel?Pls view the image for required excel columns.

urls are,
Stock Share Price dlf ltd | Get Quote dlf | BSE
Stock Share Price dlf ltd | Get Quote dlf | BSE
Stock Share Price jaiprakash associates ltd | Get Quote jaipra | BSE
up to 100 urls in a text file.

A:Web site data to excel columns

When you right click on the webpage and select "View source" from the context menu - do you see the info of interest; I don't. If the info were there, you could use InetGet. They know the value of the info being presented and they probably want to discourage automated data mining.

See if there is a mobile version of the webpage.
Relevancy 78.69%

I'm trying to find a way to delete some data from a column, say column A. The numbers to be deleted are in another column, column B. Is there a way to have excel remove from column A, those numbers that appear in column B? It would require some way to compare, but I can't figure out if excel has this capability. If the columns were small, we could do this manually, but the data set is huge, with several thousand numbers.

Thanks for any help.

Relevancy 78.69%


I have several completed templates that I need to summarize into a spreadsheet.

Is there a way for me to list down the files and the location of the excel spreadsheets and run a macro for copying the data I need from the files listed and pasting them into a spreadsheet format?

Here's what I am doing now, manually.

1. Open file1
2. Copy B2
3. Paste to SummaryFile on B1
4. Copy C2
5. Paste to SummaryFile on B2
6. Copy D2
7. Paste to SummaryFile on B3
8. Close file1

9. Open file2
10. Copy B2
11. Paste to SummaryFile on C1
12. Copy C2
13. Paste to SummaryFile on C2
14. Copy D2
15. Paste to SummaryFile on C3
16. Close file 2

I hope somebody can help.


A:Solved: Excel Macro needed for creating a spreadsheet from data on several but similar files.
Relevancy 78.26%


I need help to create an Excel macro that would

1. ask users to select x number of rows to be copied from one worksheet of one Excel file
2. once users have selected the rows to be copied, then the rows are copied from the one original Excel file into X number of target Excel files

the target Excel files are all based on the same template
there is one worksheet in each of the target Excel files

in the target files, the rows should be copied from the first available empty row, going down

Looking forward to your help!

Thanks a lot.

A:Macro needed to copy x number of rows from one Excel file into a batch of Excel files

Hi, welcome to the board.
Not much info there to get the correct picture.
Sample? Of source and template please
And not to forget, what version of Excel are you and the users using?
Relevancy 77.83%

Ok I am trying to print a spreadsheet format list. I have about 30000
title-artist entries in 2 columns. I am basically trying to print pages 1 & 2, 3-4, 5-6 and so on the same page without shrinking them way down. I want it to be just like I printed 2 columns but with 4 instead. I want to use the left side of the page for page 1 and the left side for page 2. Any help would be greatly appreciated.


A:Solved: Printing 4 Columns from 2 columns in excel

Welcome to the board. ?
Relevancy 77.83%

I am trying to hide rows of my worksheet that show a date in the completed column.
The orders that are complete have a date in column F up to this point I highlight them green so I know they are completed but it would be nice if they highlighted green and were hidden when a date was entered into the completed column.
Can someone assist me with creating a macro that will do this?
I am very new to macros so please forgive my lack of knowledge.

I have attached a sample of what I am doing however inf has been changed.

I am using Excel 2007

Thank you,

A:Solved: Macro for excel 2007 to hide rows based on any data entered in a column

Hi, welcome to the forum,

I put some simple code in the Sheet's vba

Make sure you allow macro's to be run

Just enter a date in the last row of column F for testing.

For the other green rows, just click in column F and update the date by retyping it
Relevancy 77.83%

I have an excel sheet with 3 columns. What I want to do is, I need to be able to find value in column 3, that corresponds to a value in column 2. The value in column2 should match the value in col 1.


Input Data
Col1 Col2 Col3

The result should be
Col1 Col2 Col3
Please help me.

Relevancy 77.83%

Hi A does anyone know how to search for the text content Searching Rows/Columns EXCEL Data in of a cell through a column and then return the value content of the cell of a certain other column of the same row where the text content was found e g A B C D T XY TP YZ TP ZY P YX TP YY FORMULA TP ZZ gt gt FORMULA EXCEL Searching Data in Rows/Columns quot Look for string TP in column A other than in EXCEL Searching Data in Rows/Columns row and return the value of that row in column C C YZ quot NOTE There might be more than row with the string TP in column A - I would need the sum of all results in column C where the FORMULA finds this string B I also have a similar problem with another worksheet It would require a formula which searches through a whole column for certain names e g quot Donna quot and then returns the value of another column in the same row where it found quot Donna quot the value again is not in a column directly EXCEL Searching Data in Rows/Columns adjacent to the column where quot Donna quot would be found This is fairly identical to problem A except that the search string would be unique only result and it doesn t have to take into account and disregard if the string was found in the same row of the FORMULA the search column would be in a different worksheet from the FORMULA worksheet Thanks for any suggestions Cheers from New Zealand Andreas nbsp

Relevancy 77.83%

I am having two column with current month profit & last month profit respectively Column A & Column B. I would like to compare both column & set the ICON (down Arrow & up Arrow ) based on result if A1 value greater than B1 set upper arrow else down arrow

A:How to set ICON in Excel by comparing data in 2 Columns

You didn't say where you wanted the arrows to appear, so I'll use C1 for this explanation.1 - In C1, enter this formula: =IF(A1>B1,2,IF(A1=B1,1,0))2 - Under the Conditional Formatting drop down, choose Icon Sets and then choose the Up arrow.3 - Go back into Conditional Formatting and choose Manage Rules4 - Edit the Rule for C1 as follows:----- Click the Show Icon Only box to place checkmark in box----- Change Type to be Number in both dropdowns----- Up Arrow: when value is >=2----- Sideways Arrow: when <2 and >0----- Down Arrow: when <=0 (should be default)5 - Click OKLet me know how that works for you.Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.
Relevancy 77.83%

I have two columns of data. In column A, I need to identify every cell that is identical to any value in column B.

Relevancy 77.83%

I m hoping there 2 3 columns compare EXCEL files data in is a formula within EXCEL that will allow me to complete this comparison I ve been working on it all day manually and realize it will take a long time to complete this way My computer is running on Windows Home Premium and my EXCEL is I have two different files and within each are three columns of data that I need to compare They re labeled NC NCI and SECNCI To be considered a match I need all three fields within a row to match exactly to a row within the other file The first file called REQUEST NET FILE has over rows of data so naturally there will be many repeats of these same three fields in that file but each row where the three fields match any row of data on the second file called DEPLOYED TABLE FILE needs to be the same to be considered a match If it doesn t match if possible I d also like to know why This could fall into two different scenarios NC CODE IS NOT ON DEPLOYED TABLE FILE or NCI SECNCI combo not on deployed table for this NC Once complete I ll run the same process in reverse so both files will end up with a match or no match next to each row If I need to run two separate compares one to EXCEL 2 files compare data in 3 columns get the match and then one on just the no match results to find the second bit of info I can do that Or if the second criteria can t be found via excel formula just the match no match result will be acceptable as that will save me so much time I was thinking a vlookup could do the compare for me but I m not good with vlookup formulas and after struggling a few hours with it I started searching and came across your site I ve found a few similar topics but nothing that I can translate into something for my specific need I ve attached portions of the two files and you can see on the REQUEST NET FILE where I ve managed to get to with doing it manually It s quite a tedious process so I m really hoping you can help Thank you Tech Support Guy System Info Utility version OS Version Microsoft Windows Home Premium Service Pack bit Processor Intel R Celeron R CPU GHz Intel Family Model Stepping Processor Count RAM Mb Graphics Card Mobile Intel R Series Express Chipset Family Mb Hard Drives C Total - MB Free - MB Motherboard Dell Inc G F Antivirus McAfee Anti-Virus and Anti-Spyware Updated and Enabled nbsp

Relevancy 77.83%

I have an Excel 2007 spreadsheet with 9,000+ entries. Column F contains text data (50-60 characters), which will include a 10 character serial number in the format "xxnnnnnnnn". The first two characters will always be alpha and the next eight will always be numeric.

I need to find each of these 10 character strings and copy them to column G of the same row. I do not want to do this manually if at all possible. Is there an excel formula that can do this type of function?

Your assistance is very much appreciated.


Relevancy 77.83%

Hello Everyone.

I need a help with the VBA macro.

I have one excel file & a word file. I need the data in the excel sheet to copy in to the word document.

This is what i need,

1. When you open the excel file, it has two columns Units & Comments.
2. The data in the Unit column need to replace this "XXXXXXXXXXXXX" in the word document,
3. The data in the Comments column need to replace this "cccccccc" in the word document,
4. once the unit column & comments column data is copied in to the word document. I need the word document to be saved with the file name of "XXXXXXXXXXXXX".

As a end result, i would have each file for each row in the excel file.

Is this possible? Could someone help me with this thing?

Thank you so much for looking in to this,

Relevancy 76.97%

We have a survey package which is great, but it out puts the questions numbers over the columns and each new row is a response, however our calculations are setup for the question numbers to be the rows and the responses are the columns. Is there any way to swap these values around in this fashion? Thanks for any help

A:Excel: swapping columns and rows layout of data?

Howdy. You can copy the data, then Paste Special > Transpose
Relevancy 76.54%


I was wondering if anyone could help me. I need to extract data from multiple excel files into a new excel file and sum the values. The data comes from excel files that are made from a template so the data is always in the same place or same cells. For example, i have data saved daily in excel files with the following naming convention 080204, 080304, 080404,..... and so on. What i would like to do is have a macro that will create a week ending sheet by importing and summing the data from that week.

Thanks for reading!

A:excel macro for copying and pasting data from multiple excel files

thanks for all those who read!!!! let me know if anyone needs the code!
Relevancy 76.11%

I m working on a Bill of Material creation automation project that requires some expertise in VBA and I have none The objective is to run a macro from an excel spreadsheet called quot PGE import code to VBA Macro access data to Excel - excel BOM quot to do the following Go to the folder quot C Documents and Settings Desktop Auto Project quot Find all the mdb databases in this folder Find quot HistoricalMaterialItemsAll quot table in EACH of those databases in step and import the data from Excel Macro - VBA code to import access data to excel the columns listed below Excel Macro - VBA code to import access data to excel into PGE BOM xls s columns C through G DrawingNumber ItemNumber Quantity PgeCode Description The following is a VBA code that my friend had written in Excel Unfortunately I have an older version and the code does not seem to be compatible with Excel Sub ImportAccessData Stop dPath quot C Documents and Settings Desktop Auto Project quot sFile quot MDB quot strSrch dPath amp sFile Set TargetWB Application ActiveWorkbook Set TargetWS TargetWB ActiveSheet sRow bFile False If Dir strSrch lt gt quot quot Then strFlNm Dir strSrch bFile True End If Do Until bFile False strPath dPath amp strFlNm Call GetData strPath strFlNm Dir If strFlNm quot quot Then bFile False Loop End Sub Sub GetData fl Stop strSQL quot Select HistoricalMaterialItemsAll From HistoricalMaterialItemsAll quot Workbooks OpenDatabase fl strSQL xlCmdTable Set WB Application ActiveWorkbook Set WS Application ActiveSheet iRow Do Until WS Cells iRow quot quot TargetWS Cells sRow WS Cells iRow Get the Description iRow iRow sRow sRow Loop Application DisplayAlerts False WB Close Application DisplayAlerts True End Sub The quot ImportAcessData quot sub procedure above works just fine However the red statement quot Workbooks OpenDatabase fl strSQL xlCmdTable quot line in the quot GetData quot sub procedure seems to be incompatible with excel Could someone please help debug this Thanks nbsp

A:Excel Macro - VBA code to import access data to excel

Hello, and welcome to the board!

When posting code, please use CODE tags, which extremely helps with readability.

Perhaps you could try using the code constant???...

Option Explicit

Sub ImportAccessData()
Dim dPath As String, sFile As String, strSrch As String
Dim TargetWB As Workbook, TargetWS As Worksheet
Dim sRow As Long, bFile As Boolean, strFlNm As String, strPath As String
dPath = "C:\Documents and Settings\Desktop\Auto Project\"
sFile = "*.MDB"
strSrch = dPath & sFile
sRow = 2
bFile = False
Set TargetWB = Application.ActiveWorkbook
Set TargetWS = TargetWB.ActiveSheet
If Dir(strSrch) <> "" Then
strFlNm = Dir(strSrch)
bFile = True
End If
Do Until bFile = False
strPath = dPath & strFlNm
Call GetData(strPath, TargetWB, TargetWS)
strFlNm = Dir()
If strFlNm = "" Then bFile = False
End Sub

Sub GetData(fl As String, WB As Workbook, ws As Worksheet)
Dim strSQL As String, iRow As Long, sRow As Long
strSQL = "SELECT HistoricalMaterialItemsAll.* FROM HistoricalMaterialItemsAll"
Workbooks.OpenDatabase fl, strSQL, 3 'xlCmdTable
iRow = 2
Do Until ws.Cells(iRow, 1) = ""
ws.Cells(sRow, 7) = ws.Cells(iRow, 5) 'Get the Description
iRow = iRow + 1
sRow = sRow + 1
Application.DisplayAlerts = False
Application.DisplayAlerts = True
End Sub
Relevancy 76.11%

Hi all I have a spreadsheet that holds sports results based on age groups The age groups are in one column stored as U B U G U B U G U B U G which is the age B or G boy girl The results are in another column stored as whole numbers I am trying to find a formula that will allow me to sort on the first column in the order shown above and then on the second column in descending order and then bring back the other data like the name example Child A U B Child B U G Child C U B Child D U G Child E U G would be returned as U B Child C U G Child D U G Child B U G Child E U B Child A I know I can use a manual sort but I was hoping to automatically put the results in a separate sheet in the correct order Any ideas Thanks in advance nbsp

A:Excel - function to sort multiple columns of alphanumeric data

You could easily enter in this formula:
(where the three data columns are just A, B, and C) so that you get - instead of U6B, for instance - U06B. This allows you to sort correctly by age.
If you want it copied and sorted to another page like that, you really need a macro/VBA.
Relevancy 76.11%

Hi all,

I have an excel sheet attached as an example. What I want to do is
take the data in each column and put them together into one

In my attached excel sheet I would like to have the data in each
column look like this in one separate column each line for example 1-72-bk-1803

any help is appreciated....thanks

A:Excel question: how would you connect data in defferent columns into one column?

In E1 enter
copy down
Relevancy 76.11%


I was hoping somone could please help me out.

I have an excel spread sheet with a lot of data in columns which i need to convert into rows. The problem is one column contains over 10,000 rows of data... thus making it too hard to transpose manually.

I have attached a copy of the spreadsheet (condensed version) and was hoping someone had some suggestions on how i can achieve my desired outcome.

Thanks very much,


A:Move alot of Data from Columns Excel 2010 - too big to transpose

I'm sorry to say that this is pretty much impossible as far as I can tell because there simply isn't enough consistency in your layout. If all rows were there and in order it would be easy enough.
As they aren't, one would need to inspect the titles to put them in the right place, but your titles don't always match either. For example your second "Telephone" entry is actually titled "Clinic Mobile", which the computer justly sees as very different indeed.
I'll try to help if I can, but you'll need some point of consistency if you want computers to automate a process. If it helps, here's a copy of my spreadsheet that inspects the titles (on sheet 2). If there are only a few problematic titles it might be easier to correct them manually (or use search and replace).
Relevancy 76.11%

Hi I amp m trying to work out how I can look at one column in a spreadsheet and display the text in another field but without a load of blank cells in the results column Let me give you an example On Sheet In column A are road names In column B the number of building on that to from multiple one data column 2010 Excel columns separating road In column C the last date and work was doneon the road In Column D is an IF formula thatbasically gives a result of Excel 2010 separating data from one column to multiple columns or On another sheet I want four lists Sheet In column A is a list of road names thathave a value of in Sheet column D In column B is a list of road names thathave a value of in Sheet column D In column C is a list of road names thathave a value of in Sheet column D In column D is a list of road names thathave a value of in Sheet column D I can do this with a simple IF statement in columns A B C amp D on sheet and drag it down but there are a couple of problems with this method If the value in sheet doesn amp t match I get a blank cell on sheet as there should be but this leaves a large number of cells with no value I need a list in each column A B C amp D onsheet without any blank cells I amp m going to be pasting different data into columns A B amp D on sheet a number of times and the number of rows in will be different each time I remember seeing something before thatinvolved using the IF and COUNTIF function in a formula but not sure how Any help would be appreciated nbsp

A:Excel 2010 separating data from one column to multiple columns

should be able to use an array formula - so use control + shift + enter key and the formula gets { } brackets


where you change the red =1
to =2, 3, 4 for different columns

does that work out

see attached

if it works we can extend the range and cleanup the errors
Relevancy 75.25%


I have 3 sheet name as A, B, and C. I wan to check if sheet A data has not exist in sheet B, then it will copy whole row from sheet A to sheet B and C. If data in sheet A is exist in sheet B, then it will skip to the next row.

Can someone help me with create a macro?


Relevancy 75.25%

I need help to create a macro to copy data in a range of cells resulting from another formula to a range of cells on another worksheet Specifically Summary B B to Inventory C C The data in keeps Macro failing data copy to cells Summary B B is resulting in a commands like I from other worksheets When I record the macro and select Macro to copy data keeps failing the source cells then paste at the destination cells It copies the formula from the source cells and increases the column in the source formula by to the right and looks like J I believe I need to use a macro for this as the Inventory sheet has a few different columns for doing physical counts on different days The macro will just load the current on hand count from the Summary page to the column of choice The Macro to copy data keeps failing next time a physical count is done the next column will be used and current on hand counts will be copied by the macro to the new column Your help would be greatly appreciated nbsp

A:Macro to copy data keeps failing

Hi, welcome to the forum.
I must assume that you are using Excel (since you didn't mention it), but if this is the case I suggest you also mention which version.

Have you tried editting your macro to use the real address values?

A simple sample with fictitious data will help to "see" what you mean.
Relevancy 75.25%

EXCEL Question:

I am needing to copy cells from one tab to another (and only copy cells with data) using a Macro.

Tab "Checkout" has data starting in cell A3, B3 and C3. This data could have one or more rows/columns.

I am wanting to copy this data into the "Database" tab. If there is something already entered on row, I need it to go to the next to insert the copied data.

Any and all help is greatly appreciated!

A:Copy only cells with data into another tab using a Macro

Hi, welcome to the forum.
Do you have some knowledge of VBA? If so it's quite simple.
Record a macro to copy one row from one sheet to the other.
Stop recording after that.
Open the vba editor Alt+F11 and take a look at the macro code.
If you do not have vba knowledge, then it's another matter.
Question: what happens with duplicate numbers in column B?
I don't think you just want to copy everything from sheet 1 to sheet 2?
Maybe a little more background information?
Relevancy 75.25%

Seek for help !!!

I do not have any VBA knowledge, but i know Macro can solve my below problem.
Hope you are able to help me in this.

1. Data in IA sheet will change from time to time.
2. I would like macro to Copy all data in IA sheet & paste to INV Sheet (Blue cell).
If row in Blue Cell are not enought, then it will auto insert row until all the data is filled in.
3. Freight Charges will always in last rows of data.

I really hope & appreciate your help.

I have attached my file here for easy understanding.

A:Copy & paste data using VB macro

Try this...
Public Sub CopyRows1()

' Dec 23 , Ziggy

Dim wb As Workbook
Dim wsc, wsp As Worksheet
Dim CR As Long 'copy row
Dim PR As Long 'Paste row
Dim iLastRow As Long

Dim X As String

'Set wb = ThisWorkbook
Set wsp = Sheets("INV")
Set wsc = Sheets("IA")

X = "A" ' just assigned a dummy value
PR = 25 ' assumed the Data Heading always starts on Row 25

Do Until X = ""

X = Cells(PR, 1)
PR = PR + 1


PR = PR - 1

'The last row of the sheet copying from
iLastRow = wsc.Cells(wsc.Rows.Count, 1).End(xlUp).Row

For CR = 1 To iLastRow

Sheets(wsc.Name).Range("A" & CR).EntireRow.Copy Sheets(wsp.Name).Range("A" & PR)

' colors the cells blue, but the INSERT also automatically does it
Range("A" & PR & ":I" & PR).Interior.Color = (16777164)

PR = PR + 1

' inserts a blank line
Rows(PR & ":" & PR).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

Next CR

End Sub
Relevancy 75.25%

Hi there,

may somebdoy please advise (I am pure newbie at Macros):
*I want to create button (I can dot that) and assign Macro to it:
*Copy selected cells (C3:N3)
*Paste values against respective product code (product code can be changed manually in A2)

It happens in the same working sheet (or not a problem if haapens in another sheet)

Many thanks in advance (this would save me some time and efforet)


Relevancy 74.82%

Hi all,
This is a great board-- I have received a lot of help from here!
This is my next project.
Open the attached file and, on the right of the form, there are six cells with text.
I need to concatenate these with one space in between each one, then copy the group of them and use the clipboard to paste so I can open the "save as" dialog box and paste it as the filename. We need this in our environment to be able to create the file name quickly, paste it and save the file.
I want to be able to do this with a button that activates a macro.
You can see the button on the right side when you open the file. The macro assigned to it called "createfilename". The code is in module 1.
I got it started, but I know it needs help.

A:Solved: Excel macro to concatenate and copy cells for pasting to "save as" dialog box