Find And Replace Cell That Are Blank With The Dash

Oct 28, 2009

I have a row of 2900 single letter (middle initals) however 222 users have no middle inital. this is a password scheme and need 7 digits, without the middle inital i only have 6. so I want to replace all 222 cell that are blank with a dash can this be done without doing each by hand?

View 4 Replies


ADVERTISEMENT

How To Find Middle Initial And Replace With Blank Cell

Aug 28, 2012

I have a listing with Middle Initials in column D. D also contains dates and Names. I want to remove the Middle Initials only. I need to do this without moving around cells. So a Find:="A", Replacement:="" type of situation. Right now I have 26 two line entries to take care of this, but I know it has to be easier and use less lines. (Trying to consolidate code for a better look).

Here is some of what I have (that works, but is long):

Code:
'
' Replace Middle Initial from Prod Sheet
'
Cells.Replace What:="A", Replacement:="", LookAt:=xlWhole, SearchOrder _
:=xlByRows, MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False

[Code]...

I thought that I might be able to do something like this, but I can't get it to work.

Code:

Dim Alpha as Variant
Alpha = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
For ABet = 1 to Cells(Rows.Count, "D").End(xlUP).Row
If Range(ABet) = Alpha Then Range(ABet) = ""
Next ABet

' or I thought maybe this would work.

Cells.Replace What:=("A", "L", "R", "M") Replacement:="", LookAt:=xlWhole, SearchOrder _ :=xlByRows, MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False

' or I thought maybe this would work with the variables.

If Range("B" & ABet) = Alpha Then Range("A" & ABet) = "" None of them worked though.

View 2 Replies View Related

Make All Blank Cell Have Dash Without Affecting Other Cells With Data?

Jul 20, 2013

section 100
section 200

100-1
200-1

I have a large spreadsheet with text, numbers and blank cells. Is there a code a can use to make all blank cell have a dash (-) without affecting the other cell with data.

View 8 Replies View Related

UDF - Find Consecutive Numbers In Single Cell With Dash

Mar 14, 2014

I need find consecutive Numbers in a singles Cell but each numbers have a leading zero and "-" (Dash)

My problem is that the UDF that i found on this forum, is for numbers with out leading zero with comma ",",

So even if change the "," by "-", still getting a error Because the Code is designed to Read numbers Formats different than mine..

My Numbers are located in Cell G12 (down), and the message that i need to show in the cell result is :

If Found :
0 Consecutives --> 0
2 Consecutives --> 2
3 consecutives --> 3
4 consecutives --> 4
5 consecutives --> 5
2 Set of consecutives --> 2S

Example of 0 consecutives --> 01-04-07-12-25-30
Example of 2 consecutives --> 01-02-07-12-25-30
Example of 3 consecutives --> 01-02-03-12-25-30
Example of 4 consecutives --> 01-02-03-04-25-30
Example of 5 consecutives --> 01-02-03-04-05-30
Example of 2 sets of consecutive s --> 01-02-07-12-25-26

BTW my numbers start on Cell G12 down..
______G12_______
01-02-03-20-21-25

View 11 Replies View Related

Replace Space With Dash In Text String?

Aug 7, 2013

I am looking to replace the space in between numbers and letters in a text string. The number of entries varies with each row.

Example of the entries in the column I need to reformat. Each entry is in a new row.

Code:
10 SSS
24 MNL
17 HLG 18 LTN
17 CBG 17 HLG 15 HIL 15 thn 22 ALV
17 ELP 34 HLG 15 HIL18 THN 10 TTL

What I am looking to achieve:

Code:
10-SSS
24-MNL
17-HLG 18-LTN
17-CBG 17-HLG 15-HIL 15-thn 22-ALV

17-ELP 34-HLG 15-HIL 18-THN 10-TTL

View 3 Replies View Related

Find And Replace Blank Characters

Aug 28, 2009

I download several sets of data from an internet site. The only way I can do this is to copy and paste into Excel. The problem is, that all of the cells with numbers in them show up as text, and when I press F2, I find that there is a blank space at the end of each number.

Find and replace, searching for a blank space does not work - Excel "cannot find any data to replace". That function does work on cells in which I have created my own space at the end of a number, but not on these numbers. That leads me to believe that that "blank space" is actually some other invisible character that I need to be searching for. I've attached a bit of my data - maybe somebody else can identify my phantom character.

To get around this, I have been using the formula =(left(A1,len(A1)-1), and that works, it's just that it is a pain to create another table of 20-some columns with this formula, then copy those to values, then for each column convert text to columns to change the text to values, then search and replace for #value! where the original cells were blank.

View 9 Replies View Related

Can't Get Rid Of Dash In Blank Cells

Feb 12, 2014

I have a spreadsheet that shows a dash in some blank cells and I can't get rid of it. Cells are formatted as general, there's no event code, no conditional formatting, no data validation, no auto-formatting, no nothing. I can copy a cell from outside the range with no dash in it and paste it into one of the cells with the dash and the dash remains. I can't figure it out.

View 9 Replies View Related

Replace #VALUE! Error For Blank Cells With Blank Cell

Nov 17, 2008

The formula below calculates appropriately, however, if any of the cells (E12,E14, E21, E22, E28, E29) are blank, it returns a #VALUE! error. I would like the cell to remain blank. How can I do this? The formula is listed below.

=(SUM(E34-E6)-(SUM((E12)+E14)-(SUM((E21)+E22)-(SUM(E28)+E29))))

View 9 Replies View Related

Find, Replace With And Then Replace Adjacent Cell

Mar 18, 2009

I am trying to create a macro where it finds a a certain word in a column for example C. What i want it to do is find anything that says FWD_EUR and then replace that cell (e.g C2) with CASH_EUR_FWD and after it has done that it replaces the adjacent cell (e.g. D2) with EUR_FWD. I then want this to do the same with FWD_USD to CASH_USD_FWD and adjacent cell to USD_FWD.

View 2 Replies View Related

VBA Find Zero Value (Dash) In Accounting Format

Aug 15, 2013

I have a column of data that may or may not have a formula in them. The cells are formatted in Accounting, w/o the leading $ sign. (i.e. 133.57) The value zero shows up as a hyphen or dash.

The issue is the format of the cell. In that attached worksheet, i inserted two formulas in cell b6 and b7. Both formulas are exactly the same, but the formatting is different. One is in the accounting format, but the other is in general. When I run the code, only the general formatted cell gets found.

My real worksheet is in the accounting formatted code, so I don't want to change my worksheet's numbers into a general format. How I can find the zero value thats in an accounting format?

Below is a strip down version of the code.

VB:
Sub test()[COLOR=#333333]
[/COLOR] Dim rLookInADR As Range
Dim foundcell As Range
Set rLookInADR = Range("b1:b380")
Set foundcell = rLookInADR.Find(what:=0, LookIn:=xlValues, lookat:=xlWhole)
MsgBox (foundcell.Row)
End Sub
[COLOR=#333333][/COLOR]

View 5 Replies View Related

Copy / Paste Not Replace Data (only Blank Cell)

Nov 9, 2013

How to copy paste data without replace existing data or keeping existing data?

it's possible??

View 1 Replies View Related

If Then Else Find And Replace Value In Another Cell

Aug 8, 2013

I have a file that I import into excel and append to the end of the last free position, However my totals are slightly out when compared to the main system.

I have found the reason why, they randomly slips in a Credit or credits.

So I have the scenario column P has a txt field and the majority of the time it has SI (Invoice) however when they issue a credit the txt becomes SC.

The annoying bit is that Column L has a value but it is not a negative number i.e. 75 where it should be -75

I can do an iF then and find the SC or SC's and I can place some text in Column L but I would like to be able to take the value in L and make it a negative number.

View 2 Replies View Related

Excel 2003 :: Find And Replace Missing The Ability To Replace Values?

Feb 5, 2009

This problem has come up fairly frequently lately, and I'm not sure how to fix it, or if this is by design...but in Excel 2003 I can't seem to do a "Find and Replace" based on the value of a cell. I can do a find, based on cell value, but the moment I change to the replace tab, the "values" and "comments" are missing from the "look in" dropdown.

I've only noticed this when I'm trying to replace on a filtered list, so I'm not sure if that is part of the issue.

Perhaps an alternative way of arriving at the same goal. Basically I have a worksheet with a number of filtered columns. They are filtered just right, using custom filtering, and so I do not want to undo the filters. In some columns I have formulas that are returning #VALUE! errors. I'd like to replace all of these cells with NA.

View 6 Replies View Related

Find And Replace Part Of Cell

May 20, 2009

As part of a macro i do a find and replace on a range cells that replaces "/1" with nothing (""). Therefore 2/1 becomes 2, what i don't want though is if the de-nominator includes a 1 but not only 1 to keep the whole of the de-nominator, say 8/11 does not want to become 8/1.

View 4 Replies View Related

Find & Replace All Characters In Cell Like #

Oct 14, 2009

I need help with a formula (no VBA) that will find all the semi-colons ";" and pound signs "#" in a cell and replace them with this "<br> - ".

Example of Cell A1: ;#Red;#Green;#Blue;#

I started with this:

=REPLACE(MultChoice,SEARCH(";#",MultChoice),1,"<br> - ")

but it only replaces the first character.

View 12 Replies View Related

Find/replace Using Symbol For End Of Cell?

Nov 7, 2009

Is there a way to define the end of a cell in a find/replace? I.e. I want to find characters like this:

;;[space character][end of cell]

and replace with

[end of cell]

(that is just delete the ;;[space character] bit when it is followed by end of cell)

View 5 Replies View Related

Find And Replace To Not Replace Characters Found As Wildcards?

Jul 2, 2013

I recently became owner of a spreadsheet with some issues, and I am trying to make it useful. Each row has a URL of a blog post, and I want to extract the date from it (which is present in each URL) while getting rid of the rest of the URL. I was able to get rid of everything up to the year (which comes first), but then the URL continues, for example, 2013/05/16/the-rest-of-the-url/ and I would like to just have 2013/05/16 remain.

I am trying to use find and replace with the find box reading 2013/??/??/*/ and replacing it with 2013/??/?? which effectively erases everything else in the url, but leaves ?? instead of the numbers. Is there any way to have it so that it keeps whatever was in the original box?

View 4 Replies View Related

Doing Find / Replace Not Working If Replace Text Is Too Large

Feb 5, 2014

[Code] .....

Trying to repeat a 550 or so character statement with a find/replace however I am getting type mismatch errors. When I use a smaller message in the "replace" it works.

I need it to post a message exactly as long as what I have in there. How do I get it to work?

View 6 Replies View Related

Catching Errors When Using The Find / Replace Function / Replace All

Apr 20, 2006

Need assistance with the code for catching errors when using the find / replace function in excel? In particular, I am trying to write code to break to an error message when the value or string searched for isn't found in the find / replace. At the minute I have just copied the standard code using a macro and all this does is return a message box saying X entries replaced.

View 3 Replies View Related

Multiple Find And Replace Cell Content Based On Another Cell?

Mar 25, 2014

multiple search match and replace content in a different column so for example

new workbook (look up table)
sku
search1
search2

[Code]....

so something like where you compare two tables and find and replace based on another cell that matches in my sku.. more details would be if the table column aren't exactly matching but the column header and the row header would match and fill or replace in the correct/corresponding cell is there a macro or vba to do this job in excel?

View 6 Replies View Related

Find 1 Character And Replace Entire Cell

Nov 7, 2008

how I could find 1 character and replace the entire cell. For example, it would find "<12", "<3", and "<32" based on "<" and then replaced that entire cell with "N/A".

View 2 Replies View Related

Find And Replace Part Of Another Formula With Value Of Cell

Jun 26, 2012

I have a formula in cell J2:

='H:Folder[CI10001G.xlsm]Sheet'!$C$5

I need a macro that will change the part of the formula that is "CI10001G" to the value of cell A2 which would basically be something along the lines of "CI10004D" so the formula would change to the following:

='H:Folder[CI10004D.xlsm]Sheet'!$C$5

And then this formula will then successfully look in the newly directly file path.

View 9 Replies View Related

VBA Cell Value Copy In Variable And Find Replace?

Feb 9, 2013

I'm trying to work on a macro that will copy two cell ranges (name of current month and prvious month) from one location, store it as a variable and use that variable to find replace similar text string in another tab. Below is my code which is not changing the values in another tab...

Dim OldMonth As String
Dim NewMonth As String
Sheets("X1").Select

[Code]....

View 2 Replies View Related

Find And Replace By Adjacent Cell Formula

Feb 4, 2014

Is there a formula that can find a keyword within a cell then replace it with a formula that will add the adjacent cell value up.

A1=103 B1=104
A2=104 B2=105
A3=105 B3=Out-1p-(1)
A4=110 B4=111
A5=111 B5=112
A6=112 B6=113
A7=113 B7=114
A8=114 B8=Out-3p-(23)

I am looking for a formula that can automatically calc (B3) to 106 (based upon cell A3) if the cell has a value of (*out*).

View 1 Replies View Related

Macro Will Not Run Find And Replace With The Contents Of A Cell

Apr 3, 2007

I want to have a macro that will look at a few cells say A1 & A2 and then use the contents of the cells say 1Q07 & 2Q07 respectively to do a find and replace find 1Q07 and replace it with 2Q07. I want it to use the contents of the cell and not just the text because the contents of the cell will change each time used. I tride to do it here but I dont have it yet. It doesnt seem to pass the value to the variable and the variable doesnt seem to do the find and replace.

Private Sub Update_Click()

Application. ScreenUpdating = False
Dim quarter As String
quarter = CStr(txtquarter.Text)
txtquarter.Text = CStr(quarter)

Sheets("Income Statement").Select
Dim oneq As Single
Dim twoq As Single
Dim threeq As Single
Dim fourq As Single
Dim fiveq As Single

oneq = ActiveSheet.Range("A2").Value
twoq = oneq - 1
threeq = twoq - 1
fourq = oneq - 4
fiveq = oneq - 5

View 9 Replies View Related

Find Part Of Text Within Cell And Replace From Another Cell

Nov 24, 2008

I need to find the "x" in range C2:C44 and replace it with a value (variable) specified in cell I2

The catch is that I then need to be ablt to change that character when I2 changes.

Coloum C
*VER
*T’x’STATUS
*ON
*OFF
*T’x’BANDS

EG

I2 - Variable = B
*T’x’STATUS will become *T’B’STATUS

I2 - Variable = A
*T’x’STATUS will become *T’A’STATUS

But " *OFF " should not change.

I can change *T’x’STATUS to *T’B’STATUS but then I can change *T’B’STATUS to *T’A’STATUS

Please see attached example file as it shows it better than I can explain it.

View 11 Replies View Related

Find Values On One Tab And Replace Data From Adjacent Cell

Apr 3, 2014

I have one sheet in my workbook called 'mapping' which has a list of codes on it, the length of which will vary on a periodic basis.

I have another fairly large sheet on the workbook called 'data' (around 2000 rows) that will also vary in size. I want to do a search on the data tab for each code that is contained on column 4 of the mapping tab and if the code is found, enters the corresponding value from column 1 of the mapping tab to the cell 6 columns to the left of where the code was found on the data tab (cols H and B in this case).

The issue I have is the codes maybe contained more than once on the data tab so I need the find/replace command to search the whole of the data tab and perform the task each time.

View 2 Replies View Related

Find And Replace - Text Appears Three Times In The Cell

Apr 19, 2014

I am trying to use find and replace but the text that i'm searching for appears three times in the cell. I only need to replace the first occurrence in the cell. Alternatively, if there is a way to do this, can the second and third occurrence be changed?

Example:

Cheryl called Louie to advise she would be late for the meeting. Louie responded that he would meet Cheryl at her office. Cheryl confirmed.

I need to change the first 'Cheryl' to a job title and the second and third Cheryl to her initials (CL) so would read:

Manager of Aboriginal Affairs called Louie to advise she would be late for the meeting. Louie responded that he would meet CL at her office. CL confirmed.

View 9 Replies View Related

Find And Replace Function Using Cell References And Wildcards

Mar 29, 2012

Any way to use a find and replace function involving a cell reference. I have a spreadsheet with ton of junky text burying information that I want. Here is a simplified example

A B
Book 345353hg dgdgsdgfd fff Book belongs to Jim
Sneaker fdg4 Sneaker is worn by Jan
Gum dfg s d e te4345Gum tastes great
Cake jklsjflsjfjikCake smells delicious

The pattern is that the A1 text appears in the B2 text. What I want is

Find *A1
Replace with blank
Find *A2
Replace with blank
and etc.

So that in the end, I get this:

B2
belongs to Jim
is worn by Jan
tastes great
smells delicious

I've looked at the functions of find, replace, substitute, left, and right and I can't seem to find the right one to do what I need.

View 3 Replies View Related

Using FIND Function In Macro To Replace Value In Adjacent Cell?

Aug 10, 2012

I am using a macro to find a value in a cell and if found, replace the value in the cell to the left. Thr macro works fine - unless the value I am searching for does not exist. The answer is ( Ithink) an IF statement, but I am having problems with the errors, when I try the IF.

The macro below blows up at the ActiveCell.Offset(0, -1) = "109073X line with an error "Run-time error "1004" - Application-defines or object-defined error.

I've tried a number of things I've seen from this board but have not found a way past the error.

If the value is found, the macro moves to the else statment and stops at the ActiveCell statement with the above error. If the value is not found, then the macro goto NotFound.

Sub Macro2()
'
'Range("A1").Select 'Start from the home cell
Dim ValueFound As Object
Set ValueFound = Cells.Find(What:="Cirrus Reversals/CREDITS")
If ValueFound Is Nothing ThenGoTo NotFoundElseActiveCell.Offset(0, -1) = "109073X"'ActiveCell.FormulaR1C1 = "109073X"End If
NotFound:
End Sub

View 3 Replies View Related







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