Excel 2010 :: Copy Entire Row If Cell Contains Specific String

Apr 5, 2012

I am a total newb to excel and vb, and only have minimal experience in embedded C.

I have a very large spreadsheet with 9 columns and the max number of rows that excel supports (office 2010).

What I want to do is copy the entire row of data IF a cell in that row contains a specific string I'm interested in.

If it's necessary, the column that contains the values that would trigger a row copy would be column C and the data would be pasted onto a new sheet.

View 1 Replies


Copy Entire Row If Cells In Row Contains Specific String

Apr 3, 2013

I'm trying to copy entire row from sheet "source" to sheet "output".

Condition: If cell or cells in range (E7: lastcoll, lastrow) value is "A" then copy entire row.

Find the excel template in attachment.

My problem is that my macro is copying particular row, as many times as many "A" finds.

I want to copy entire row just once doesn't matter how many cells with "A" are in particular row.

'function to find last column a change letter of column to number
Private Function ColLetter(LastCol)
ColLetter = Split(Cells(1, LastCol).Address, "$")(1)
End Function

[Code] .....


View 3 Replies View Related

Excel 2013 :: Copy Entire Row If Cell Contains Specific Text And Paste Values Into Another Worksheet

Jun 23, 2014

I am using the code below in Excel 2013.

Sub Test()
For Each Cell In Sheets(1).Range("J:J")
If Cell.Value = "131125" Then


This works great except that it pastes formulas. I would like to paste values only. I've tried
" PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False" and it gives me an error.

View 3 Replies View Related

Copy Entire Excel Sheet Cells Values Into String Array?

Mar 3, 2014

How to copy the content of cells from an excell->sheet1 to an string array

View 2 Replies View Related

Excel 2010 :: Highlight Entire Record Based On Value Of Single Cell?

Apr 10, 2013

MS Excel 2010, WinsXP

how to highlight an entire record based on the value of a single cell?

I would like to highlight all records grey where cells in a column = "closed".

View 4 Replies View Related

Alter Existing Formula To Copy Specific Cells In Row Instead Of Copy Entire Column?

May 1, 2014

I need the macro to look at cells B9:B84 on the Sheet1 tab of the Cost Template. If it finds an x I need it to copy the 3 cells to the right of the x and paste them in a template. For example if it sees an x in cell B9 it would copy cells C9, D9 and E9, open the Purchase Order to the Detail tab, then paste it to cells B3, C3 and D3. It would continue looking for an x down to B84. So if it found 5 cells with x, it would give me 5 instances of the Purchase Order with 3 cells pasted into each.

I've attached my Cost Template and the Purchase Order it needs to copy to. In the Cost Template is a macro called Create_PO. This is what I was trying to alter to make this happen. I can't seem to get it right! FYI in case it matters, I had to change the Cost Template from .xltm to .xlsm in order to upload it on this site.

View 11 Replies View Related

Excel 2010 :: Return Result For Appearance Of Text String In Any Cell In Row?

Jan 30, 2014

I deal with a rather large excel database (the range is A1:AV168266) that contains customer information. Some of these various customers are affiliated with a group called "ascend" and I need to be able to filter all my list by every customer affilliated with Ascend. The trouble is that the word "ascend" can appear in 8 different columns and usually when it appears in one column it doesn't appear in the others and their can also be more text in the cell beyond the word "ascend". I want to create a formula that will simply look for the word "ascend" in any cell of a row and return a result I can filter by. I will be putting the formula in column AW and put it in all 170,000 rows of that column, that way I can just filter by a single column.

I've played around with combining COUNTIF with SEARCH and MATCH with SEARCH but nothing seems to work.

View 7 Replies View Related

Excel 2010 :: VBA - Run Code Only When Clicking In Specific Cell?

Dec 23, 2013

how to run some VBA code (written by someone else, unfortunately) only when clicking once in cell A1, and not run in any other cell. This is being run in Excel 2010. The code I would like to run in this manner is below, and currently will run when the user clicks on any cell in the worksheet it is applied.

Option Explicit_________________________________________
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'If IsDate(Target.Cells(1, 1).Value) Then
Set DatePickerForm.Target = Target.Cells(1, 1)
DatePickerForm.Show vbModal
Cancel = True
'End If
End Sub

View 3 Replies View Related

To Search In All Excel Files In A Folder And If Find In Any Cell Copy Entire Row

Feb 13, 2014

I have a macro that searches in all the excel files contained in a folder (weather files are opened or not) and returns the information (File name, Sheet name , Cell Address, and contents of the cell). I just want to amend the said code so that it copies not just the cell alone but" the entire row in which the cell is present".

My code is as follows

[Code] ......

View 4 Replies View Related

Excel 2010 :: How To Return Value Of Cell Beneath A Cell With Specific Value

Jun 14, 2014

What I'm trying to do is, create a formula that works like vlookup, except I want to return the value of the cell that is a specified number of cells below the looked-up data in a single column array. So, let's say cell A1 reads "Bacon". In B1, I'd like to put a formula which searches the array for the cell that contains "Bacon" and then returns the value of the cell underneath, let's say the value is "Eggs". Then in C1, I'd like to put another formula which also looks up "Bacon" in the array, then returns the value of the cell that is down two cells from the cell that contains "Bacon", let's say the value is "Milk". And then in D1, a formula that returns the value 3 cells below "Bacon", and so on. All the values here will be text, and not sorted in any specific order. I'll be using Excel 2010.

Please take a look at the attached sheet if it clarifies things.

View 3 Replies View Related

Excel 2010 :: Display Column If Single Cell Has Specific Value

Nov 27, 2012

I'm using Excel 2010 and I'm having troubles displaying hiding my column B if none of the cells of column A contains either "(Quasi Echec)" or "(Quasi Russite)" at least once.

PHP Code: [URL] ......

Below are my 3 attempts.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim c As Range
If Target.Column 1 Then Exit Sub
Application.EnableEvents = False
On Error Resume Next

[Code] ..........

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Sub GetUniquesInColA()
Dim rng As Range
Dim c
If Target.Column 1 Then Exit Sub
On Error Resume Next

[Code] .........

Option ExplicitPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim x As Long
Dim LastRow As Long
LastRow = Range("A65536").End(xlUp).Row

[Code] ...........

View 2 Replies View Related

Excel 2007 :: Creating Order Form - Copy Entire Row If One Cell Has Data

Dec 3, 2012

I'm trying to create a very simple order form. It's been a while since I've done this in Excel, and I couldn't find an answer when I searched. (I may be a lousy searcher, though.)

I want the user to enter a quantity in Column E of the "Common Items" worksheet, and have all the rows with quantities copied to the "Order" worksheet. (On the "Order" copy below, I just did a copy/paste to show the desired effect.)

Excel 2007

Item Number

0.9% NaCL 1000ml Bags

[Code] ....

I'm pretty sure this can be accomplished with an If/Then, but I'm lost! Optimally, they'd enter their quantities, click on the Order sheet and hit print.

View 5 Replies View Related

Excel 2010 :: How To Make Concatenate To Generate A Text String Using Custom Formatted Value Of A Cell

May 2, 2014

I have an Excel 2010 spreadsheet that I am using to save several numbers all in the same column. These numbers can range from the several thousands up to billions. The formatting I am using for these numbers is Number (using 1000s separator).


I am also using the spreadsheet to generate a text string for each of the numbers. I don't want the text string to show the number as it is, I want to shorten the number by only showing the first few digits followed by a "B" for billion, "M" for million, or "K" for thousand. For example, in the text string I want to show 1,600,000 as 1.6B.

In order to shorten the number I use the cell in the column to the right of each number. This cell uses the following custom formatting (which I found by doing a Google search): [>999999999.999]#.0,,,"B";[>999999.999]#,,"M";#,"K";


As you can see the formatting is quite complex (at least for me it is) but it does what I want it to do.

Here is a screenshot of what the original and custom formatted cells look like:


As you can see the custom formatting works and does exactly what I wan

The next column (after the custom formatted number) is where I put the generated text string for each of the numbers. As I stated above, I want the generated text to use the shortened version of the number (e.g. 1.6B).

To generate the text I use the CONCATENATE function with a reference to the cell containing the shortened number as one of the arguments. For example:


Where B1 is the custom formatted cell.

The problem I am running into is, the text that gets generated doesn't show the shortened format of the number, it shows the full number. Here is a screenshot demonstrating what is happening:


As you can see the generated text is "SOME STRING 1600000000". This is not what I want. I want the generated text to be "SOME STRING 1.6B".

I think I understand what's going on. When the CONCATENATE function references a cell it takes the actual value of the cell and ignores any formatting. (I suppose formatting is just the way you see the data, not how underlying functions receive the data.)

My question is, how can I re-write the CONCATENATE function (or use another function, etc. available to me) to use the formatted version of the cell?

*UPDATE* I have attached my spreadsheet as an attachment to this post (tackyjan_excelforums.xlsx). Please note that it was created and saved using Excel 2010.

View 8 Replies View Related

Excel 2010 :: Unhiding Specific Number Of Worksheets Based On Cell Value

Jun 26, 2013

I have been attempting to cobble together code from different forums for the past several hours to make a macro to unhide a specific number of worksheets based on a cell value, and have failed miserably thus far. Here are the specifics of what I have going on:

Microsoft Excel 2010
Workbook Name: TASERR Model - 06-26-13.xlsm

In this workbook, I have a worksheet called "Input". In cell C21 of that worksheet, workbook users will fill in a number between 1 and 50 (I have the value for that cell limited to those numbers through data validation). Based on the value in that cell (C21), I want to make a macro to unhide that specific number of hidden worksheets. I have 50 hidden worksheets which are named "Route (1)", "Route (2)", "Route (3)", etc.. If the value in cell C21 is 7, I want the worksheets named "Route (1)", "Route (2)", "Route (3)", "Route (4)", "Route (5)", "Route (6)", and "Route (7)" to unhide. If the value in cell C21 is 3, I want the worksheets named "Route (1)", "Route (2)", and "Route (3)" to unhide. I'm sure y'all can see the functionality I'm going for at this point.

View 8 Replies View Related

How To Find A Specific Text And Copy This Entire Row

Jul 12, 2007

I tried to writer my code myself but I have a long way to go. Here is what I must do for my case:

I want a macro to find the row that include a specific text (For example "SMSC") in a range (A1:A100) then copy this entire row below the cell which has the value "OTHERS". That is, if there are 10 pieces of "SMSC" so these rows including "SMSC" should be listed below the cell "OTHERS"

View 9 Replies View Related

Excel 2010 :: Cannot Unhide Columns By Selecting Entire Worksheet

May 29, 2012

I have Columns A to C which are hidden. I have tried to unhide these bey selecting the entire worksheet but to no avail. I am using Office 2010.

View 4 Replies View Related

Excel 2010 :: Return Oldest Date In Entire Sheet

Mar 19, 2014

in Excel 2010, whether using VBA or otherwise;

1) how can I return the oldest date in the entire workbook (or at least in the entire sheet if it's not possible to find that date in the entire workbook).

2) how about the most recent date ?

View 2 Replies View Related

Excel 2010 :: Copy Hyperlink To Other Cell?

Nov 21, 2013

how can I copy and paste only the hyperlink of one cell to the other cell with the same worksheet or workbook? I am using Excel 2010.

View 9 Replies View Related

Excel 2010 :: Pivot Table Conditional Formatting - Highlight ENTIRE Row

Aug 16, 2013

I am using Excel 2010. I have a pivot table where I want to highlight the ENTIRE row where a certain cell value equals something.

In essence I want all the Material Subtotal Rows highlighted "Orange" But as you can tell from the picture below I am having issues with the Body of the Pivot table. I have the formula checking to find whenever it finds the word total to highlight it.

The example below is showing how I need the row to be formatted. I can get the Data (Units) section formatted no problem. It is just the other part of the pivot table that I cannot format.

For the columns from Material to SAP # I have been trying to use Dynamic Name ranges using the Offset function. However, excel turns that Name range to a range and if I filter the pivot table, it adds extra ranges to the Applies to box and starts to really mess it up.

View 2 Replies View Related

Excel 2010 :: Copy Data From One Cell Based On Color Of Another Cell To Different Worksheet

Jan 30, 2014

I have an Excel 2010 spreadsheet consisting of many worksheets (20 or so). Each of these worksheets contain detail level data regarding different projects. One of the columns in these worksheets is the 'Status' column (column F). There is conditional formatting on this column where if the text is 'G' then change background to a green color, 'Y'=yellow, 'R'=Red and 'U'=Grey.

The first worksheet is a summary sheet that I would like to pull information from each of the detail worksheet's columns B, D, E, G and H if the status column (Column F) is 'R' or 'Y'.

The number of rows in the detail worksheet can change each week (as few as 0 and as many as 100)

View 2 Replies View Related

Excel 2010 :: Find A Cell Within Range Then Copy That Cell To Another Location

Sep 26, 2013

(I am using Excel version 14.0.7106 and MS Office Professional 2010.)

I have a macro in which I have named a range of numbers in a spreadsheet, used the "find" function to find a particular number in that range, and now would like to copy some information into a cell in the same row as the found number. However, when I try to move over to the cell that I'm copying to, it only goes to the 1st row in the range that I have defined.

Here's the portion of code I think you need to see. Everything works...it finds a match...but then I don't know what to do from there to get the information to the correct row:

'Grab the 1st project number
Do Until ActiveCell.Value = ""
If ActiveCell.Value "" Then
prjnum = ActiveCell.Value
Selection.Offset(0, 8).Select

[Code] ..............

View 7 Replies View Related

Delete Entire Row If Cell Contains String

Jan 30, 2008

I need to write a macro that will search column A and find the word hospital or HOSPITAL and if found delete the entire row. The code I have below will do this ONLY if hospital or HOSPITAL is the only word in the cell. However in my column A there are numerous words in each cell i.e Saint Mary's Hospital.

Sub KillRows()
Dim rngNew As Range
Dim rngDelete As Range
Dim aCell As Range
Dim lastrow As Long
Set rngDelete = Nothing
Set rngNew = Worksheets("Sheet1").Range("A1", Range("A65536").End(xlUp))
For Each aCell In Selection
Select Case aCell.Value...........

View 5 Replies View Related

Excel 2010 :: Copy Contents Of Column Based On Value In Another Cell

Jul 30, 2013

I'm using excel 2010 and windows XP with a moderate amount of experience tinkering with macro programming. I know what I need is very doable but I can't get my head around what the code would look like. I must not be wording my searches correctly because most of what I'm getting for results are iterative programs based on a cells value which isn't what I need.

I'm trying to build a macro that will check a cell (C3) and based on the contents of that cell copy a column (I) to one of 12 different columns (K:V). So if the value in C3 is 1 it should copy I to K, if the value is 2 it should copy I to L, and so on.

View 2 Replies View Related

Excel 2010 :: Copy Cell Contents From A Permission Protected File

Apr 17, 2013

S/W Environment: Excel 2010

Some of my worksheets are permission protected. They will allow me only to view the sheets - No editing, copy, cut, sort, add filter, etc. Is there a way to hack this and copy data (including formating) into other / new worksheets?

View 1 Replies View Related

Excel 2010 :: Search Column For Match If Found Copy Cell To Next Vacant Row

Jul 8, 2014

I have a file which has in excess of 12,000 rows of data in 5 columns (sample file attached with fake data). The five rows are:

"First Name" "Last Name" "Name" (uses CONCATENATE to combine column A & B) "Email" "Date Attended"

There will be duplications in the list as people will have attended more than once over the years.
What I want to do is search through the email addresses (Column D with D1 being the header) and where there is a duplicate email address copy the cell to the right of the duplicate (F#) into the next available cell to the right of the first occurance and then delete the row with the duplicated email address.

I am on Windows 7 and Excel 2010

View 4 Replies View Related

Excel 2010 :: Copy Multiple Numbers From Single Cell To Individual Cells?

Apr 15, 2014

I am using Excel 2010.

At work, we've got a program that outputs the results of a search into an Excel file, in column 1 below.






I need to get that list of numbers listed out to the right, with one number per cell. The list in column one could possibly contain from 1 to 20 numbers, and the last number is always without the comma after it.

View 5 Replies View Related

Excel 2010 :: Macro To Copy 3 Cell Values And Append To Existing Database File

May 14, 2014

I'd like my macro (in an Excel 2010 workbook) to copy values from three worksheet cells and append them to an existing Access or SQL database file -- without having to leave my Excel spreadsheet or open any other programs. The database file simply needs to be appended. Keeping a running list. That file isn't being used for anything else, we can set it up however is necessary to do this.

For example, Excel cells A1, A2, and A3. Representing Job Name, Job Number and Job Total.

how make VBA do this(in SIMPLE terms)? Or give me a link of where to look or what to search for? I understand VBA but not Access or SQL.

View 1 Replies View Related

Highlight Entire Row When Any Cell In 1 Column Contains Specific Value

Aug 24, 2008

Code that will highlight a entire row when a cell from a column has a value of 0. It will check all the cell from Column C1:C100 and check all the cells that contains a 0 value. Need to highlight the entire row that contains this cell value and fill it in orange color.

View 9 Replies View Related

Excel 2010 :: Set Row Height Based On First 14 Characters In String?

Feb 23, 2012

Excel 2010; I am setting row heights on the basis of some parameters. I have the following statement;

If targetCell.Value = "Photo Comment: " Then
targetCell.RowHeight = 185

But what I really want is to recognize only the phrase;

"Photo Comment:" in a text string that might be much longer e.g,

"Photo Comment: The photo above depicts yata, yata.........."

So, I want to recognize the first 14 character as "Photo Comment:" and then have the row height adjust to 185. So it involves "Left" and "Len" (I'm thinkin') but the syntax is beyond me.

View 1 Replies View Related

Excel 2010 :: Nth Character In A String - Parsing Shortcut?

Feb 1, 2013

I have an Excel sheet with lots of shortcuts in the first column. It's the entire shortcut, including the .lnk extension.

What I need to do is to be able to parse out the string to make the shortcut human readable when I create the hyperlink. I'm saving the output as HTML for a user to open these shortcuts. It's on an internal LAN & secure. Using various versions of Excel (2010, 2007 & 2003, predominately the first). Trying to make an ugly, 140+ character shortcut into a more readable form for web navigation purposes.

Up to a point, the shortcuts are similar:

but, later on, they vary from that point out.


The strings are the same up to the 7th occurrence of the "" character, but after that, the foldernames start to change & the shortcut may be down a level (an extra folder) or more. Also, the lengths of the strings change as well, so I can only do positional parsing up to a point.

View 4 Replies View Related

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