Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.fr.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Custom formatting numbers & dates with a template (for receipts/invoices)

I have a template that I use to make receipts. One of the cells holds
the information that I would like to change every time I open the
template. For instance, the first order in Jan. 2004 looks like this:
1-J04
The second order in Jan. 2004 looks like this:
2-J04
First order, Feb. 04:
1-F04
And so on. I can't seem to figure out how to do this & would really
appreciate help! TIA. -Jude
  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.fr.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Custom formatting numbers & dates with a template (for receipts/invoices)

Public Sub Auto_Open()
Dim iPos As Long
Dim iVal As Long

With Worksheets("Sheet1").Range("A1")
If Right(.Value, 3) = Format(Date, "mmm") Then
iPos = InStr(1, .Value, "-")
iVal = Left(.Value, iPos - 1) + 1
.Value = iVal & "-" & Format(Date, "mmm")
Else
.Value = "1-" & Format(Date, "mmm")
End If
End With
End Sub

put it in a standard code module

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jude" wrote in message
om...
I have a template that I use to make receipts. One of the cells holds
the information that I would like to change every time I open the
template. For instance, the first order in Jan. 2004 looks like this:
1-J04
The second order in Jan. 2004 looks like this:
2-J04
First order, Feb. 04:
1-F04
And so on. I can't seem to figure out how to do this & would really
appreciate help! TIA. -Jude



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Cell Formatting Using % With Dates Jason McDonald Excel Worksheet Functions 2 March 10th 10 04:13 PM
dates are formatted as custom date but still display as numbers Trainer Excel Discussion (Misc queries) 2 April 14th 09 07:14 PM
template for tenant invoices Annief Excel Discussion (Misc queries) 1 September 5th 06 08:31 AM
IS THERE A AUTO TEMPLATE FOR INVOICES ej New Users to Excel 1 January 9th 06 03:48 AM
Custom Formatting for Dates nastech Excel Discussion (Misc queries) 7 November 14th 05 09:23 AM


All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"