custom format & saving

Is there a way to save this format type so I can use it in another workbook?  
The custom format only stays in the workbook it was created in.

Also, how do I create a format for something like 12-34-5F or 12-34-56?
00-00-00 works if all digits but won't work in the first example.  @@-@@-@@ 
just repeats everything nor does @-@-@ work.

Thanks!
0
kdw1 (2)
6/20/2005 6:36:07 PM
excel.misc 78881 articles. 5 followers. Follow

6 Replies
660 Views

Similar Articles

[PageSpeed] 16

Unfortunately, I think the best way for you to do this is to enter it as 
text. (put a hyphen before your entry)

"kdw" wrote:

> Is there a way to save this format type so I can use it in another workbook?  
> The custom format only stays in the workbook it was created in.
> 
> Also, how do I create a format for something like 12-34-5F or 12-34-56?
> 00-00-00 works if all digits but won't work in the first example.  @@-@@-@@ 
> just repeats everything nor does @-@-@ work.
> 
> Thanks!
0
BJ (832)
6/20/2005 7:52:02 PM
I bet bj meant the apostrophe ('), not the hyphen (-).



bj wrote:
> 
> Unfortunately, I think the best way for you to do this is to enter it as
> text. (put a hyphen before your entry)
> 
> "kdw" wrote:
> 
> > Is there a way to save this format type so I can use it in another workbook?
> > The custom format only stays in the workbook it was created in.
> >
> > Also, how do I create a format for something like 12-34-5F or 12-34-56?
> > 00-00-00 works if all digits but won't work in the first example.  @@-@@-@@
> > just repeats everything nor does @-@-@ work.
> >
> > Thanks!

-- 

Dave Peterson
0
ec357201 (5290)
6/20/2005 9:56:38 PM
You can create a workbook template and save it to your XLStart folder (save it
as book.xlt).

Then put everything you want new workbooks based on that template to
inherit--custom formats, page layouts, headers/footers, etc.

Then when you click on that New Icon, the new workbook will inherit all these
settings.

And numberformats work with numbers.  

You could use a worksheet event that looks for changes and changes the values in
those cells to the nice format you like.

If you want to try this, rightclick on the worksheet tab that should have this
behavior.  Select view code.  Paste this into the code window.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim myCell As Range
    Dim myRng As Range
    Dim myStr As String
    
    Set myRng = Intersect(Target, Me.Range("a:a"))
    
    If myRng Is Nothing Then Exit Sub
    
    On Error Resume Next
    Application.EnableEvents = False
    For Each myCell In myRng.Cells
        With myCell
            If IsNumeric(.Value) Then
                .NumberFormat = "00-00-00"
            ElseIf Len(.Value) = 6 Then
                .Value = Left(.Value, 2) & "-" & _
                         Mid(.Value, 3, 2) & "-" & _
                         Right(.Value, 2)
            End If
        End With
    Next myCell
    Application.EnableEvents = True
    On Error GoTo 0

End Sub

Change this line to just the range that you want "formatted":
Set myRng = Intersect(Target, Me.Range("a:a"))
(I used all of column A.)

And if you typed in a number, I changed the format.  If you typed in text, I
changed the value.

kdw wrote:
> 
> Is there a way to save this format type so I can use it in another workbook?
> The custom format only stays in the workbook it was created in.
> 
> Also, how do I create a format for something like 12-34-5F or 12-34-56?
> 00-00-00 works if all digits but won't work in the first example.  @@-@@-@@
> just repeats everything nor does @-@-@ work.
> 
> Thanks!

-- 

Dave Peterson
0
ec357201 (5290)
6/20/2005 10:06:37 PM
senior moment

"Dave Peterson" wrote:

> I bet bj meant the apostrophe ('), not the hyphen (-).
> 
> 
> 
> bj wrote:
> > 
> > Unfortunately, I think the best way for you to do this is to enter it as
> > text. (put a hyphen before your entry)
> > 
> > "kdw" wrote:
> > 
> > > Is there a way to save this format type so I can use it in another workbook?
> > > The custom format only stays in the workbook it was created in.
> > >
> > > Also, how do I create a format for something like 12-34-5F or 12-34-56?
> > > 00-00-00 works if all digits but won't work in the first example.  @@-@@-@@
> > > just repeats everything nor does @-@-@ work.
> > >
> > > Thanks!
> 
> -- 
> 
> Dave Peterson
> 
0
BJ (832)
6/21/2005 12:25:03 PM
Dave, I tried your approach of using the Change Event and it worked, although 
it isn't quite what I was looking for originally.  I'll have to keep this 
piece of code in my 'folder' for future reference.

I gather that the short answer to my question is that we can't create Custom 
Format for non-numbers ( at least not in the Format Cell menu).  I wonder if 
this has changed in the newer version of Excel?

"Dave Peterson" wrote:

> You can create a workbook template and save it to your XLStart folder (save it
> as book.xlt).
> 
> Then put everything you want new workbooks based on that template to
> inherit--custom formats, page layouts, headers/footers, etc.
> 
> Then when you click on that New Icon, the new workbook will inherit all these
> settings.
> 
> And numberformats work with numbers.  
> 
> You could use a worksheet event that looks for changes and changes the values in
> those cells to the nice format you like.
> 
> If you want to try this, rightclick on the worksheet tab that should have this
> behavior.  Select view code.  Paste this into the code window.
> 
> Option Explicit
> Private Sub Worksheet_Change(ByVal Target As Range)
> 
>     Dim myCell As Range
>     Dim myRng As Range
>     Dim myStr As String
>     
>     Set myRng = Intersect(Target, Me.Range("a:a"))
>     
>     If myRng Is Nothing Then Exit Sub
>     
>     On Error Resume Next
>     Application.EnableEvents = False
>     For Each myCell In myRng.Cells
>         With myCell
>             If IsNumeric(.Value) Then
>                 .NumberFormat = "00-00-00"
>             ElseIf Len(.Value) = 6 Then
>                 .Value = Left(.Value, 2) & "-" & _
>                          Mid(.Value, 3, 2) & "-" & _
>                          Right(.Value, 2)
>             End If
>         End With
>     Next myCell
>     Application.EnableEvents = True
>     On Error GoTo 0
> 
> End Sub
> 
> Change this line to just the range that you want "formatted":
> Set myRng = Intersect(Target, Me.Range("a:a"))
> (I used all of column A.)
> 
> And if you typed in a number, I changed the format.  If you typed in text, I
> changed the value.
> 
> kdw wrote:
> > 
> > Is there a way to save this format type so I can use it in another workbook?
> > The custom format only stays in the workbook it was created in.
> > 
> > Also, how do I create a format for something like 12-34-5F or 12-34-56?
> > 00-00-00 works if all digits but won't work in the first example.  @@-@@-@@
> > just repeats everything nor does @-@-@ work.
> > 
> > Thanks!
> 
> -- 
> 
> Dave Peterson
> 
0
kdw1 (2)
6/22/2005 3:35:22 PM
Yep.  When excel says NumberFormat, it means number format <vbg>.



kdw wrote:
> 
> Dave, I tried your approach of using the Change Event and it worked, although
> it isn't quite what I was looking for originally.  I'll have to keep this
> piece of code in my 'folder' for future reference.
> 
> I gather that the short answer to my question is that we can't create Custom
> Format for non-numbers ( at least not in the Format Cell menu).  I wonder if
> this has changed in the newer version of Excel?
> 
> "Dave Peterson" wrote:
> 
> > You can create a workbook template and save it to your XLStart folder (save it
> > as book.xlt).
> >
> > Then put everything you want new workbooks based on that template to
> > inherit--custom formats, page layouts, headers/footers, etc.
> >
> > Then when you click on that New Icon, the new workbook will inherit all these
> > settings.
> >
> > And numberformats work with numbers.
> >
> > You could use a worksheet event that looks for changes and changes the values in
> > those cells to the nice format you like.
> >
> > If you want to try this, rightclick on the worksheet tab that should have this
> > behavior.  Select view code.  Paste this into the code window.
> >
> > Option Explicit
> > Private Sub Worksheet_Change(ByVal Target As Range)
> >
> >     Dim myCell As Range
> >     Dim myRng As Range
> >     Dim myStr As String
> >
> >     Set myRng = Intersect(Target, Me.Range("a:a"))
> >
> >     If myRng Is Nothing Then Exit Sub
> >
> >     On Error Resume Next
> >     Application.EnableEvents = False
> >     For Each myCell In myRng.Cells
> >         With myCell
> >             If IsNumeric(.Value) Then
> >                 .NumberFormat = "00-00-00"
> >             ElseIf Len(.Value) = 6 Then
> >                 .Value = Left(.Value, 2) & "-" & _
> >                          Mid(.Value, 3, 2) & "-" & _
> >                          Right(.Value, 2)
> >             End If
> >         End With
> >     Next myCell
> >     Application.EnableEvents = True
> >     On Error GoTo 0
> >
> > End Sub
> >
> > Change this line to just the range that you want "formatted":
> > Set myRng = Intersect(Target, Me.Range("a:a"))
> > (I used all of column A.)
> >
> > And if you typed in a number, I changed the format.  If you typed in text, I
> > changed the value.
> >
> > kdw wrote:
> > >
> > > Is there a way to save this format type so I can use it in another workbook?
> > > The custom format only stays in the workbook it was created in.
> > >
> > > Also, how do I create a format for something like 12-34-5F or 12-34-56?
> > > 00-00-00 works if all digits but won't work in the first example.  @@-@@-@@
> > > just repeats everything nor does @-@-@ work.
> > >
> > > Thanks!
> >
> > --
> >
> > Dave Peterson
> >

-- 

Dave Peterson
0
ec357201 (5290)
6/22/2005 11:22:00 PM
Reply:

Similar Artilces:

Custom Entity Relationship CRM 3.0
I have created a new custom entity (A) for which I need to create two referential relationships to other custom entities (B) & (C). (A) is the primary entity in both cases. The relationship between (A) and (B) acts normally. The relationship between (A) and (C) doesn't. When I try to add a (C) record from (A), (A) displays two records in the (C) lookup. One "record" displays data from system fields (created on and status). The second "record" displys data from the primary field. I am not able to access (C) record from the associated view in (A), but I can a...

Custom toolbar and macros
I am moving a user from Windows 2000 to XP and he has a worksheet with many custom Macros as well as the custon toolbar with it. We can move the worksheet and the macros will move with it. The problem is moving the custom toolbar with it. How do I get the toolbar to move along with the worksheet. One way: With the custom workbook active, choose Tools/Customize/Toolbars. Click Attach. Attach your custom toolbar to the workbook. In article <F0FC2885-07CB-4706-BC67-DEB7B664BACF@microsoft.com>, "MD" <MD@discussions.microsoft.com> wrote: > I am moving a user fro...

toolbar customization
533 MHz Power PC G4 384 MB SDRAM MAC OS X 10.3.3=20 Office X: Excel 10.1.5 (Service Release 1) When I drag command buttons to Excel's Standard Toolbar I get grayed-out = icons as follows: Hide Detail Show Detail Insert Rows Ironically the following buttons, dragged in precisely the same = fashionto the=20 Standard Toolbar, work satisfactorily: Insert Columns Delete Column Delete Row Any suggestions? Has MS discoveed and repaired these bugs for the May=20 2004 updates? While they're not bugs, they are confusing. You probably dragged the Insert Rows button from the Edit categ...

CRM Customization: Display Contact Info on Service Activity Form
We'd like to be able to open a service activity, and display all of the associated contacts' information (name, phone, address) on the same form. We have attempted to use IFRAMEs to load this information, but have so far been unsuccessful in achieving the desired effect. What is the best approach to take here? I am trying to do the same... What I really want is: 1) Service activity calendar view to show the customer name, number and address in the mouseover 2) When a service calendar item is clicked on, I would like the contact name, address and telephone listed in the main fo...

Tracking customer orders when receiving stock
With our current POS system we can place items on order for a particular customer (whether we are holding the stock or not) and when we generate purchase orders the system automatically pops up letting us know we have pending orders for customers. We can then generate a purchase order based on this information. When we receive the stock, we can print out a report for that order that lists what stock needs to be allocated to which customers. Is there a way with RMS that we can do this? Unfortunately it is a regular occurance that our stock levels can be incorrect, for instance we may have a 0 ...

Customize Does not WOrk
When I clip the customize outlook today button, it does not respond. Anyone have an idea of what the problem might be? Posted several times a day here: OL2000: You Cannot Customize Outlook Today After You Install Critical Update 813489 for Internet Explorer: http://support.microsoft.com/default.aspx?scid=kb;EN-US;820575 -- Russ Valentine [MVP-Outlook] "Glenn" <anonymous@discussions.microsoft.com> wrote in message news:05cb01c3cc7b$467a26c0$a101280a@phx.gbl... > When I clip the customize outlook today button, it does > not respond. Anyone have an idea of what the pr...

How to display HTML in Custom Task Pane
Does anyone know if it is possible to program a custom task pane in Office 2007 (using VSTO) to display hosted web content (i.e. HTML). How about locally stored HTML? My team is looking at ways of providing modest on-screen assistance to support our custom Add-in that docks nicely within the application and can be coupled with a few controls. If it's not possible, we're stuck using CHM. Thanks in advance. ...

Money 2004: Can't balance savings account
Hello, I'm trying to balance my saving account in Money 2004. This is the first time for this account. I fill in all the info such as statement date, ending balance, etc. Then when I hit "next" nothing happens. The dialog stays up and I can't continue. The only way to get out is to hit "cancel" which of course doesn't balance the account. Anybody know what's going on? Thanks, Boaz ...

Word text copied into email loses formatting alignment
When copying a Word document (containing indented and numbered paragraphs and bullet points into an email, the left alignment of the document loses its justification. How can this be fixed? -- HK If the formatting is important, send the document as an attachment. You have no control over how the recipient sees the email. If you are concerned that the recipient might not have Word, use one of the free pdf converters to convert the document into a .pdf file. -- Hope this helps, Doug Robbins - Word MVP Please reply only to the newsgroups unless you wish to obtain my s...

XY Scatter with Custom Labels
I have a list of products, each with an X (a dollar amount) and a value (a percentage). Is it possible to have each point labeled with custom value i.e.: Printer, or Digital Camera, rather than it bein labeled with just the values being plotted ($1,000, 2% or $500, 7%)? Any ideas are appreciated. Thanks, Keit -- hatzipe ----------------------------------------------------------------------- hatzipet's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2789 View this thread: http://www.excelforum.com/showthread.php?threadid=47392 You can edit the text of a labe...

In excel 2000 My work was not saved because of power failure what.
I was just working on excel 2000 and I lost my work because of the power failure I have lost so many daa and now gainnig unnecesory pains. can you plase help me ? Hi if you haven't save your data then the data is probably lost -- Regards Frank Kabel Frankfurt, Germany "jatin_Soni" <jatin_Soni@discussions.microsoft.com> schrieb im Newsbeitrag news:782EAEA2-958D-42D8-8BCF-5B6CF046D003@microsoft.com... > I was just working on excel 2000 and I lost my work because of the power > failure I have lost so many daa and now gainnig unnecesory pains. > can you plase ...

Using either 'Conditional Formatting or VB' to color specific Cells
All, I'm new to using macro's within Excel, please forgive my ignorance in advance! heh Does anyone know the best way to color cells within a worksheet based on data in other rows within the same worksheet? I've used Conditional Formatting but it only lets me use (3) colors. I need to use about 10 or so. Basically I have data in columns A - P, in columns AI:AJ I have data that I want to show as a specific color in rows A - P if it exists. Can someone give me an example that I can use and modify to do this task? Thanks -J I assume that you want an easy way to visually identify ce...

Change dates to a custom format via formula ... how to?
Hello, A2 has formula =NOW() which makes date today in this format: Tue.Apr.26.2011 How can I get my custom date formats so that the above date shows up as Tu.Apr.26.2011. In another sheet, I was kindly given this to make these types of changes: =IF($A$2<>"",TEXT($A$2,"yymmdd.")&CHOOSE(WEEKDAY($A$2),"Sn","Mn","Tu","Wd","Th","Fr","Sa"),"") I tried this, =NOW()&CHOOSE(WEEKDAY($A$2),"Sn","Mn","Tu","Wd","Th","Fr","Sa&...

Conditional Format: Dates
Date is displayed in cell like this: Thursday, January 01, 2004 Currently, cells have no cell color format. How can I set formatting so cells containing 'Sunday' are a different color? Is there a formula I can use or some function that will do this for me? If the dates are text use =ISNUMBER(SEARCH("Sunday",A1)) in the formula is box, if they are real dates use =WEEKDAY(A1,2)=7 format>conditional formatting and formula is -- Regards, Peo Sjoblom "JEM" <abc@def.com> wrote in message news:emRrHL1IEHA.2688@tk2msftngp13.phx.gbl... &g...

Preserve Pivot Format
I'm currently testing out Office 2007 for my company (we currently use 2003) and I've run into a couple of questions regarding pivot table formatting. 1. In 2003, when I told a pivot table to "preserve format," it actually worked. For example, I have a page field in which the text gets very long. I'd like to have it "taller" and with wrapped text. In 2003, I changed that field to "all", set my formatting, and refreshed the pivot - worked great, the cell stayed as formatted. In 2007, I have "Preserve cell formatting on update" checked. I rep...

Customer Report
Hello, I am hoping someone might assist me with a problem. I am trying to customize a customer report to show the Notes from the customer file. It has been suggested to me to run a query on this to pull the info I want. This is great, but not ideally what I am looking for. I want anyone in the office to be able to run the report and filter it to their specifications. For example: we have an anual catalogue and we do not send it to everyone on our mailing list. We want to send it to local customers who have spent money with us or who specifically request a catalogue. We have used up all ...

How to Customize Business Portal to show custom objects?
Hi, I need to Customize Business Portal to show my custom objects in "Primary Publishing List ResultViewer Web Part","Rich List ResultViewer Web Part","Form ResultViewer Web Part"? I need to create pages similar to Customer Summary page in sales center with my custom objects. How can i do that? Thanks, Mohan ...

Custom X-axis
Hi everyone. I need to create a custom x-axis in which the values double at each interval. i.e. At the first interval the value must be 20, the next 25, 31.5, 40, 50, 62 ...20,000. Even though the numbers do not have an similar differences (e.g. 25-20 is not equal to 62-5) I will still need these values to be equally spaced. Thanks for any help you give, it's greatly appreciated! Fred. PS. If you want to know what I'm doing, I'm plotting an amplitude:frequency graph, where each spacing between each frequency is 1/3 of an octave. Fred - Two options. Make a Line chart,...

GPS Customization Query
Hi All, Is there a way to avoid/remove "Quick Links" and "Help" links from the Business Portal Site for the end users? Any help on this would be very handy. Regards, Kuldeep ...

change local customer to global customer
I am trying to change the local customers that i have in my store database to global customers in hq I ran this querie in store administrator UPDATE Customer SET GlobalCustomer = 1 Then ran worksheet 401 in hq, but the customers did not update, then worksheet 350. Can someone help? Had the same issue ... this worked for me - need to set globalcustomer = 1; need to set lastupdated = getdate(*); need to set storeid = 'xxxx' (whatever is appropriate for you). Go into SO Manager and configure ENABLE GLOBAL CUSTOMERS and NEW CUSTOMERS DEFAULT AS GLOBAL. Need to run 401 TWICE (once...

How to customize column width in Ressource Usage report ?
Hi, When printing the Workload, Ressource Usage report, some of the durations are stated as #####.##. I tried to make the font smaller but it did'ent help. How do I make the report readable? I am using MS Project 2007 SP2. Br Bertrand If you goto Reports, Custom you can see all of the built-in reports and you can see what they are made of and you will see that they use a filter and a table (and other settings and stuff). The column width of each field is a property of the table. Find the report that you are interested in, then find the table that it uses, then e...

Formatted numbers problem
When I open reports in excel, I often see numbers that read 1.00043E +11, apparently indicating that there is a number format problem. When I change the cell format (to text or number), I am usually able to see the full value in the cell. However, I must first physically enter each cell (i.e., selecting the cell, and then double clicking, and then pressing enter) in order to accomplish this effect of seeing the full value. Is there a way to get around this? Thanks for any suggestions. How about using Number in the format|cells|Number tab|number category Show the 1000's separator and ...

customize public folder
Hi, I have exchange server 2003, on a windows 2003 server environment. 1) I want to remove or hide the "favorites" folder under the public folder tree? 2) May I not to use the existing public folder tree structure? Public folder --> All Public folders --> (Company contacts) Public folder --> (Company contacts) Thanks, On Tue, 30 May 2006 15:32:25 +0800, "Classmate" <NoEmailAddress@abc.com.hk> wrote: >Hi, > > > > I have exchange server 2003, on a windows 2003 server environment. > > > >1)...

Save Times Changing Without Saving
I don't know if this is an excel thing or a LAN thing, but I've started noticing that my excel files are changing save time after I've had them open without me saving them. I know the time for an open file will list the time it was opened, but I'm talking about the open time staying with the file even after it is closed. I'm running excel 2002, XP Pro, and I think the server is Win 2000. (It's a large corporate WAN) Has anyone had this problem? If you still have the workbook open, then this is normal. But if you've closed the workbook without saving (and nothin...

Custom ActiveX control fails on release build
Some time ago I created simple custom control (.ocx) using Visual Basic 6. Recently I decided to also use my control in VC++ apps. VB: Using the ActiveX Control Interface Wizard and the Property Page Wizard I added the appropriate handlers and a simple property page to change the appearance, border, colors, and fonts. Nothing special there. VC: The control was installed and registered on the test machine through the installer and is located in the system folder. On the development machine the application runs fine and the new control works great. On the test machine the dialog box fail...