Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Cell data change formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paco.E - 18 Feb 2007 05:43 GMT
I have a user form where cell A1 is a input field for "WeekNo., No of days,
or Date. The date is selected by use of the build in calandar.
The range A2-A12 are referenced to A1+1, A1+2 etc.
This works fine, as long the Date is not used, because the Calendar will
convert the formatting of the cell to the "date" format.
The formula:  & Text(today(),"mm/dd/yy") cannot be used as this format the
Cell to text, not allowing the range A2-A12 to be updated when the date is
selected.

Your help or guidance is appriciated.
thanks.
Paco.E
merjet - 18 Feb 2007 20:04 GMT
I didn't understand your remark about WeekNo., No of days. With A2 =
A1+1 etc. A2:A12 work fine for me, except they show serial dates. They
are easily switched to date format, e.g.:
Private Sub Calendar1_Click()
Sheets("Sheet1").Range("A1") = Calendar1.Value
Sheets("Sheet1").Range("A2:A12").NumberFormat = "m/d/yyyy"
End Sub

If this doesn't work for WeekNo. or No of days, you can change the
format of A2:A12 in a similar way.

Hth,
Merjet
Paco.E - 22 Feb 2007 06:31 GMT
Hi Merjet,
Thks, sorry for the slow reply, but was tight up in Lunar NY celebrations
"Con chi fa Chai"

Yes, my question is  confusing.
Here again,

How do I reset cell A1 format after the use of the calandar, which format
the cell A1 to Date (e.g dd/mm/yy)
So the next case cell A1 is used for number format
(as needed for No.of days; e.g. "3"),
The cell still indicate a date format e.g. 03/01/00 instead of the number 3
How do i reset the date back to numeric??

Thnks

> I didn't understand your remark about WeekNo., No of days. With A2 =
> A1+1 etc. A2:A12 work fine for me, except they show serial dates. They
[quoted text clipped - 9 lines]
> Hth,
> Merjet
merjet - 22 Feb 2007 14:08 GMT
Range("A1").NumberFormat = "0"

Hth,
Merjet
Paco.E - 23 Feb 2007 04:43 GMT
thanks
Paco.E

> Range("A1").NumberFormat = "0"
>
> Hth,
> Merjet
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.