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
962 Views

Similar Articles

[PageSpeed] 48

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:

Number format issue Access 2007
Access 2007. I've created a database with a number input and I'm getting the following errors. I've formatted a field as Number Field Size: Single Format: Currency Decimal Places: 0 I'm getting the following results Input 2,065,000,000 but it's rounding it to 2,064,999,936 Input 2,682,000,000 but getting rounded to 2,681,999,872 Any ideas on the reason for this? Do I have that field formatted properly? You help is GREATLY appreciated! (B^>)-]=[ Single is a floating point type. Accuracy is only 7 or 8 significant digits. More info: ...

Combining cells
Using Excel 2002: I will open a text file into excel. This file has no formatting, but the end result would be using two columns. The text file for example has: Music1 from site1 and site2 special 90876 Music100 extra from site1 87654 Music02 misc sites 10020 I want to put the numbers, 90876, 87654, 65409 in the same column "B" and have the other text combined into one column "A". When I use space delimited I can move the numbers in the same column. How do I combine the rest of the text which are word for word in columns A,B,C,D etc into one column "A"? End...

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

Convert European currency format to dollars
I have currency data which is stored in Euopean currency and I want to format it to dollars on a regular basis. Is there an easy way for Excel to do this?. I have tried formatting cells and replacing characters by search and replace, but this is bit hit and miss. The data is stored as 1.234,56 and I want to convert it to 1,234.56 Mark In Excel, click on Tools/Options, then the International tab. The top section is "Number handling", and you can specify what you want to use as decimal and thousands separators. Click on the Use system separators box to remove the check mark, an...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

Q: How to automatically adapt column width with XML format?
Hi. I'm developing an application that outputs its results to an XML file (with Excel XP's DTD). The trouble is the column width, which is set at default. Is there an XML tag which allow to adapt width automatically? I thought about a VBA macro, but I noticed that VBA code isn't stored in XML Excel's files. Thanks in advance, Francesco. ...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

Copy row2 cells down to last cell where the whole row isn't all blank
Hi Colo, I tried to run your code to copy formula in cell K2 (I place the cursor on cell K2) down to last cell in column K, it doesn't copy down the formula. Is there anything missing from the code ? Please help and thanks very much! Sub Cell2CopyToEnd() Dim col As Long col = ActiveCell.column Range(Cells(2, col), Cells(Rows.Count, col).End(xlUp)).Formula = _ Cells(2, col).Formula End Sub --- Message posted from http://www.ExcelForum.com/ I put a value in K99 (so the macro knew when to quit) and I put a formula in K2. With K2 selected, I ran the code and it worked fine. The co...

wrong number in cell
In XP PRO & Excel 2002 I have a cell formated as General and unlocked. I try to enter a number { 08607100 } I hit enter and it changes to { 8607100 } no matter what I try it. This is another example of a problem in a cell I enter { 03E2 } hit enter and it changes to { 3.00E+02 }. Is there some bug in certain cells or with excel 2002 or is there some setting I am missing? Help -- Thanks MK pipco wrote: > In XP PRO & Excel 2002 I have a cell formated as General and unlocked. I > try to enter a number { 08607100 } I hit enter and it changes to { 8607100 &g...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Matching number formats
I am using an INDEX/MATCH formula and do get a "VALUE NOT AVAILABLE" response. Both ranges have a "General" format. A [Copy][Paste Special][Formats] does not make the formats match. How can I make them respond to each other? On Thu, 12 May 2005 10:36:09 -0700, "raystub" <raystub@discussions.microsoft.com> wrote: >I am using an INDEX/MATCH formula and do get a "VALUE NOT AVAILABLE" >response. Both ranges have a "General" format. A [Copy][Paste >Special][Formats] does not make the formats match. How can I make them >resp...

Duplicate cells #4
I have an excel spreadsheet of approximately 1500 Names,addressses etc. there are many duplicate cells of which I want to delete the duplicates and I am looking for the best way to accomplish this. I am new to excel and using formulas but if there is a way to use color to point out the duplicates, that would be very helpfull, thanks You could try to use Advanced Filter to get rid of the duplicates. Ensure that you have headers in row 1 (Name, Address_1, Address_2 etc) and highlight all the data including the headers. Then click Data | Filter | Advanced Filter and in the pop up click Un...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Table formatting lost
I receive emails that started off in Excel as a short table. The sender then cuts and pastes into Outlook. When the message arrives it has lost all formatting for the table. Is there any solution apart from sennding as an Excel attachment? Do the copy as a Picture and then paste in Outlook. -- Gary''s Student - gsnu2007k "him@privacy.net" wrote: > I receive emails that started off in Excel as a short table. The > sender then cuts and pastes into Outlook. When the message arrives it > has lost all formatting for the table. Is there any solution apart > from se...

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

Spreadsheet getting corrupted
Hello All: I have a relatively large spreadsheet. I am getting errors (see after my signature line). What could be causing these errors? Is it that the spreadsheet is too large? Thanks Deguza -------------------------------------------------------- Microsoft Office Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\deguza\My Documents\sales\Sales_2006_2007.xls' The following is a list of repairs: Global PivotTable report information was repaired due to integrity problems. Global PivotTable report information was repaired due to integrity problems. Glo...

referencing a cell determined by name in another cell
How do I reference a cell within a formula based on the contents of another cell? For example if one cell contained a reference/address for a column array, how could I refer to this cell (and hence the column array) within the vlookup function instead of having to put in the actual table array. In other words an external way of changing the table array rather than going into the formula. VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) Hi use INDIRECT for this -- Regards Frank Kabel Frankfurt, Germany "ricardo wants answers" <ricardo wants answers@discussion...

Reg getting the next IV Document Number field !
Hi, I am creating a window in dexterity similar to the item transaction entry window (Transactions>Inventory> Transaction Entry). In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field. I wanted to know if there is any function , or table that i can access to get the next document number in the new window that i am creating. Thanks, swetha -- swetha >In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field.< T...

enhanced conditional formatting
i want a conditional formatting system that is not limited like the current one. currently i can only set 3 conditions and the formating settings for each condition being true in the following scenario i would require 6 conditions that would require the values of more than 1 row/column to be of a specific value to create the desire effect. they are as follows: 1) if drivable is = yes and elapsed between 0 and 6 cell shadow green 2) if drivable is = no and elapsed between 0 and 3 cell shadow green 3) if drivable is = yes and elapsed between 6 and 9 cell shadow orange 4) if drivable is = no...

Get notified when Out of Office is on
I am using Outlook 2007. With 2003, when returning from leave, I used to get a notification that the Outlook out of office was still on and asking me if I wanted to switch it off. This reminder no longer appears with 2007. How can I switch this setting on so that I get the notification? "Mary Ann" <MaryAnn@discussions.microsoft.com> wrote in message news:ED5533A7-D0EA-41B8-B1A0-A9D15FB6FD98@microsoft.com... >I am using Outlook 2007. With 2003, when returning from leave, I used to get > a notification that the Outlook out of office was still on and asking me ...

How do I get??
Sorry if this seems a fairly easy question to you guys. I have a spreadsheet and I need to get the current system time into a cell. The format of the time is hh:mm am/pm. Any assistance would be most helpful. Hi try =INT(NOW()) in this cell and format is to your needs -- Regards Frank Kabel Frankfurt, Germany PM wrote: > Sorry if this seems a fairly easy question to you guys. > > I have a spreadsheet and I need to get the current system time into a > cell. The format of the time is hh:mm am/pm. > > Any assistance would be most helpful. PM, in the cell you want pu...

Getting Control ID in Active X control
GetWindowLong return 0. You need to call GetDlgCtrlID from outside the activex control as the function available within the control returns an arbitrary value of zero. Take a look at this article http://xendra.ens.uabc.mx/~sinfante/loo/libro/ch17_4.htm particularly the paragraph preceeding the title "MFC and Ambient Properties". This really begs the question why you want the ID in the first place as activex controls have to be fully self containing to operate - with a few exceptions where sibling controls need to be able to locate each other. - Tim "ytv" <...

over VPN, it gets stuck when sending outgoing email
When I use VPN to connect to work from home, the outlook can not finish sending outgoing emails. The progress bar moves to the end but then stops there forever. It can never finish. The receiving of new incoming emails work fine. All other network functionality works, e.g. internet browsing, telnet, ftp, etc, all work fine. My system is win2k. I use linksys wireless DSL router. I'd appreciate any hint! Are you using Exchange server? I'd set up your mail profile to prompt you to work offline or online - when using VPN, work offline with scheduled syncs. If not using exchange, pos...