how to get the format of this cell right?

When I let go:

Selection.Replace " ", Replacement:="-", Lookat:=xlPart, _
                                SearchOrder:=xlByColumns,
MatchCase:=False, SearchFormat:=False, _
                                ReplaceFormat:=False

" " is entered by means of an array:
Words = Array(" ", "+", "/", "---", "--", "&")

on a cell containing: 5 a
I would expect to get: 5-a as a result.

Unfortunately, it produces 5:00:00-AM. How can I solve this tiny but
frustrating problem?


best regards
Peter
0
ppeer
11/30/2009 10:52:04 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
1577 Views

Similar Articles

[PageSpeed] 55

Format the cell as TEXT before entering a value to that cell.  HTH  Otto

"ppeer" <trafo0234@gmail.com> wrote in message 
news:3e5dc66d-00c1-4a7a-824f-885f9911818b@j35g2000vbl.googlegroups.com...
> When I let go:
>
> Selection.Replace " ", Replacement:="-", Lookat:=xlPart, _
>                                SearchOrder:=xlByColumns,
> MatchCase:=False, SearchFormat:=False, _
>                                ReplaceFormat:=False
>
> " " is entered by means of an array:
> Words = Array(" ", "+", "/", "---", "--", "&")
>
> on a cell containing: 5 a
> I would expect to get: 5-a as a result.
>
> Unfortunately, it produces 5:00:00-AM. How can I solve this tiny but
> frustrating problem?
>
>
> best regards
> Peter 

0
Otto
11/30/2009 11:17:28 PM
Reply:

Similar Artilces:

When I am in one cell highlight another
Hello, When I am in one cell highlight another. Lets say that if my cursor is in A1 I want D1 highlighted or with another cursor on it. Then if I move to A2, D2 should be the one with another cursor or highlighted. Thank you for your help, Jose Juan Diaz hi, Jose Juan ! > When I am in one cell highlight another > ... if my cursor is in A1... D1 highlighted or with another cursor on it. > ... if I move to A2, D2 should be the one with another cursor or highlighted. 'put' a cursor on non-active-cell... [I don't think it's possible] :( to highlight 'D' wh...

Cells print so small I cannot read numbers. How do I fix?
I have been working with page break. Now I have the grid on 1 page..but it is far to small to read. now when I try to spread it back to 2 pages, it just takes the same tiny microscopic type and spreads it into 2 pages. I am stuck printing tiny type. How can I get the grid cells back to a size that is readable. It sound like you have selected Fit to 1 page in File > Page setup > Page > Scaling. Either select to fit it to 2 pages or select Adjust to 100% size -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings sandymann2@mailinator.com Repl...

Excel Regional Date Format Options
A client of ours in NZ is complaining that date format options for English (New Zealand) have changed from older versions of excel (they are using 2003) Some of their spreadsheets have dates formatted as dd-mmm-yy, mmm-yy and dddd,dd,mmm but these options do not exist anymore. Is there anyway to add options to this list without using the custom format option? Thanks, Jesse I just compared the Excel 97 and Excel 2003 built-in date formats and they are mostly unchanged. 2003 has a few more but I don't think there were any subtractions. The formats dd-mmm-yy and mmm-yy are righ...

Get paid to post in forums..
myLot promises to pay as you talk on its discussion boards. You can post and reply to whatever topic that you like. to join: http://www.mylot.com/?ref=blogger1 The following is taken from their website: ****************************** How does this work? We have implemented a system to give everyone who uses the internet the ablity to make money. The idea is pretty simple - if you contribute to the myLot Community - whether it is by posting a new discussion, responding to a current discussion, commenting on a current discussion, or referring friends, you earn money. Our goal is t...

Process all cells in a (user) selection
I am using this code to give me cell by cell access to a code defined selection; Dim aCell As Range For Each aCell In Sheet4.Range("A4:A34") ' Do Stuff Here Next aCell which processes every cell in the A4:A34 Range How do I do the same thing for a selection drawn by the user before pressing my 'Process' button ? Thanks On 05 May 2010 11:10:21 GMT, Isis <isissoft@NOSPAMbtinternet.com> wrote: >I am using this code to give me cell by cell access to a code defined >selection; > >Dim aCell As Range >For Each aCell In S...

ALL of my email is gone- getting error message as well
I am getting this message: The message store has been corrupted by an application external to Windows Mail. Windows Mail has been able to successfully recover from this corruption. (0x0000000) In addition ALL of my emails are gone. Any suggestions on how I can recover them? And what I should do about the message. Try running the various repair functions in the WMUtil program: http://www.oehelp.com/WMUtil If still no improvement, upgrade to Windows Live Mail: http://download.live.com/wlmail It will automatically import all your WM data. Gary VanderMolen, Microsoft MVP (Mai...

Navigation Bars
I put Navigation bars on my publisher website document. When I try to publish to a file or to the web, the Navigation Bars do not appear on the page(s). How do I resolve this?? Answer found in the web group. DavidF "Tom Snyder" <Tom Snyder@discussions.microsoft.com> wrote in message news:7A55B689-FE9D-4E1E-9B6C-3ED571156D46@microsoft.com... >I put Navigation bars on my publisher website document. When I try to >publish > to a file or to the web, the Navigation Bars do not appear on the page(s). > How do I resolve this?? Tony, did you get an answer to this...

How do I get address book to include e-mail address?
When I select to: box in the new message the search box does not include the e-mail address and is not included in the address line. How do i fix that? Any chance the Contacts folder has lost it's "Show this folder as an E-mail Address Book" checkmark in Properties? http://support.microsoft.com/kb/197577/en-us "Show this folder as an e-mail Address Book" check box is dimmed in Outlook Contact folder properties Hal -- Hal Hostetler, CPBE -- hhh@kvoa.com Senior Engineer/MIS -- MS MVP-Print/Imaging -- WA7BGX http://www.kvoa.com -- "When News breaks, we fix it!...

think cell program
is anyone familiar with a program called think cell? Any thoughts? (powerpoint v 2003). Is this an add-in? thanks Sara It's very good. You can "try for free" from their website: http://www.think-cell.com/ Recent interview with one of the founders on Indezine: http://blog.indezine.com/2009/12/think-cell-conversation-with-markus.html -- Echo [MS PPT MVP] http://www.echosvoice.com What's new in PPT 2010? http://www.echosvoice.com/2010.htm Fixing PowerPoint Annoyances http://tinyurl.com/36grcd PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/3...

How do I get deleted items that stay in inbox with line thru them.
I inherited a computer at work. Outlook is setup so that when I delete a message it stays in the inbox, with a line thru it. How do I get the deleted items to go automatically to the deleted item folder? "rwwhit" <rwwhit@discussions.microsoft.com> wrote in message news:7D17761E-CD1B-4D04-BACB-B0D837C4DD93@microsoft.com... >I inherited a computer at work. Outlook is setup so that when I delete a > message it stays in the inbox, with a line thru it. How do I get the deleted > items to go automatically to the deleted item folder? That's normal behavior...

Where can I get UNLIMITED Excel stock qoutes?
The Excel Add-in that allows you to retrieve stock qoutes is limited in taht it only allows you to get about 250 qoutes at a time. How can I get unlimited qoutes in a format compatible with excel? Z There's a program called Historical Stock Quotes which can create tab or comma delimited files that can be read into Excel. If you want something that updates automatically within Excel, you may have to buy an add-in. Have you searched the web? On Sun, 6 Mar 2005 12:18:23 -0800, ZouBCivil <ZouBCivil@discussions.microsoft.com> wrote: >The Excel Add-in that allows you to retriev...

Newbie Cell Reference Question...
Hello, I apologize if this question has been answered before, but I'm no quite sure what to search for as I'm not very good with excel. I'm making a spreadsheet where one sheet references another. I'll tr to explain this as best as possible.... I'm creating a spreadsheet for a fantasy basketball league. I have "Data" sheet that contains data for all players. I have another sheet "Teams" that has all the players on each team. Column B contains th players name, and column C contains a number that corresponds to th row this player is on in the dat...

getting IIS login credentials
In my webforms app, I am using Page.Users.Identity.Name to get the user name. Does anyone know what the MFC equivalent is? I am wanting to modify the MFC code of an older application to do some stuff that I am doing in a webapp. ...

Where can I get a template that will calculate profloss after buy.
I need a template that will calculate all the possible variables in a share trade. The rate on buying, every day entry (7 days),Profit/loss on holding, prof/loss on sale etc. ...

Cannot get CRM client for Outlook online
One of my customer's employees is having problems to get his CRM client for Outlook online (version 3.0). The error he is receiving says: "An unknown error has occurred. Retry the action. If the problem persists, contact your system administrator.". In the event log we find the following warning message: Event Type: Warning Event Source: MSCRMAddressBook Event Category: None Event ID: 6425 Date: 10/12/2006 Time: 1:53:18 PM User: N/A Computer: AVELTP0131 Description: The current user does not have permission to use the Microsoft CRM Address Book. Contact the system administr...

How to get rid of a "line" in Word
If I type a number of dashes in Word and press Return it automatically gets changed into a continuous line. How do I later remove such a line? Sometimes if I delete the text line above it then the line also goes but often I just can't get rid of it. I have to resort to creating a new document and then copy/paste the god bits over and then delete the old document. Thanks. -- Les Desser (The Reply-to address IS valid) In news:lzqSlgmVscxLFAoG@dessergr0up.invalid, Les Desser <NewsDump1@dessergroup.com> typed: > If I type a number of dashes in Word and press ...

Conditional formatting help #4
My problem is that, that i want to ignore blank i mean i had set a conditional formatting say A B C D 24.9 25.9 25 25.8 22.6 23.4 22.5 23.3 If value in ColA is less than value in ColC, cell A1 is shaded blue OR if value in ColB is greater than value in ColD, cell B1 shaded blue. I have done above formatting but my problem is that if i dont enter anything in colC then also colA is shaded in blue similarly if i dont enter any value in colD then also col B is shaded.I mean i want to ignore the blank.I need , if col C is blank then the Col A must be normal .& if col D is blank & i ent...

VFW, webcam, image format
Hello, I'm trying to grab pictures from a webcam with Video For Windows (VFW). The source code I use is the following: HWND _capwnd = capCreateCaptureWindow("Capture",WS_POPUP,0,0,1,1,0,0); capDriverConnect(_capwnd,0); capGrabFrame(_capwnd); capEditCopy(_capwnd); OpenClipboard(NULL); HBITMAP hBmp = (HBITMAP)GetClipboardData(CF_BITMAP); CloseClipboard(); BITMAP bmp; GetObject(hBmp, sizeof(BITMAP), &bmp); int size = bmp.bmWidth*bmp.bmHeight*bmp.bmWidthBytes; unsigned char* data = new unsigned char[size]; GetBitmapBits(hBmp,size, data); ...

Getting an UnBound control value into a Table field??????
I have a form that calculates a production rate in "parts per hour". This form needs to be able to differentiate between Line work, Cutter work, Side work, and Blister work. I created a drop down list for selecting the "Study Type" as listed above. I then created a text box for each "study type". When I select the "study type" each text box checks to see if the selection applies to it and makes the calculation if it does apply. The code for the "Line" study is as follows: =IIf([StudyType]="Line",2700?/[SecondsPerPart])...

Cell background shading in Excel
Why is it that the background shading colors available under the Paintbucket Icon chjange from file to file? Also, how can I add some of the colors to the paintbucket that are availabe under the format/cells/pattern pulldown? Colors are a Workbook-level property, so you can change the color palette for any workbook. Choose Tools/Options/Colors... and modify the colors to your hearts' content. You can also import another workbook's color palette from that dialog. Note however, that there are only 56 bins in the color palette, so you can only use 56 colors at a time. The paint b...

Internal emails get bounce backs, external work fine
I have a strange problem. Running Exchange 2003 enterprise service pack 1 One user, can't get emails internally. We get the following message: Greg Montgomery on 5/9/2006 10:19 AM The message could not be delivered because the recipient's destination email system is unknown or invalid. Please check the address and try again, or contact your system administrator to verify connectivity to the email system of the recipient. But externally it works fine. So people emailing Greg using his SMTP account, all is well. Here is a kicker though. All of a sudden, some people can now...

Sum every other cell?
I own a used-book shop. I have an Excel SS to track how many books pe day I sell in each of 28 categories and the $$$ I take in for eac category. So there's two columns for each day: #books & $$$. therefore want to add every odd-numbered cell in a row to get the tota number of books for a category in a given period of days and ever even-numbered cell in the same row for the the total $$$. Is there simple formula or function for this -- bookmanj ----------------------------------------------------------------------- bookmanjb's Profile: http://www.excelforum.com/member.php?acti...

Comparing 4 dates and getting 1 headache
Hi everyone, I have a problem hopefully some one can help me out with. I have the following 4 dates… Beginning Date of Service Ending Date of Service Eligible Beginning Date of Service Eligible Ending Date of Service I need a formula that will compare the Beginning Date of Service to the Eligible Beginning Date of Service, if the Eligible date is later it will take that if is earlier then it will take the Beginning Date of Service and compare it to the Ending Date of Service if the Eligible Ending Date of Service is later then the Ending Date of Service or the Ending Date of Serv...

How do I get Excel?
I have Excel Viewer, but that only allows me to look at Excel files and not edit them. I'd like to know if there's any way that I can get my hands on or download any version of the program WITHOUT having to buy any expensive Microsoft Office Software? Obviously, if I go that route, then the much earlier versions would be in order. I also have Microsoft WORKS, but it's not Excel either, is there a way to convert between these two programs? Thanks. Hi no legal way to download Excel. Some options: - Microsoft offers a Trial version of its office products on their website (ch...

opening a powerpoint document which is protected by Information Rights Management
We have a Powerpoint 2007 document which some former employee in our office created before he left a year ago. Now, we need to open it and when we try it, the document mentions you don't have read permission for this. Do you want to obtain permission from that person's organizational email address which does not exist as he has left. We tried to contact the former employee who does not have that document with him at present. Is there any way we can open the document? I don't know enough about Information Rights Management(IRM), but understand like PGP it is a tool ...