Formatted Date In Message Box String

Oct 29, 2006

how can i get a cells date into a message box string? i have been trying to get this to work

Dim Date As String
Date = Sheet16.Range("a1").Value
MsgBox "Today is the & Date ", vbOKOnly

View 3 Replies


ADVERTISEMENT

Formatted Date In Message Box

Nov 16, 2006

this code works fine on my desktop but on 2 of work's pc's it produces a error at the msgbox line

Private Sub Workbook_open()
'http://www.ozgrid.com/forum/showthread.php?p=306542&posted=1#post306542
Dim dDate As Date
dDate = Sheet16. Range("a1").Value
MsgBox "Today is the " & Format(dDate,"dd/mm/yy"), vbOKOnly
End Sub

i have changed the security settings in macro's and one of them was using office 2000, not sure about the 2nd one but i will check next time iam at the office and grab the error codes.

View 2 Replies View Related

Dates To String But Cell Formatted As Number

Feb 11, 2014

I'm working on a sheet for our accounting section which has been in use for quite some time, which means, that I'm not supposed to change a hell of a lot in it since it's accounting and everybody is afraid of changes.

Coming to the point, I have the following problem:

(1) I have a date.
(2) I need that date in this format: "mm-yyyy", written in a certain cell.
(3) BUT: the cell should NOT contain the date itself, but JUST the text (some tables in the background need this format)
(4) Changing the cell to text-format is not eligible, since it puts an " ' " in front of the numbers.
(5) The cell should be formatted as a number.

So, in conclusion:

I need a string/number with the date in this format: "mm-yyyy" in the cell formatted .NumberFormat = "0".

I'm working on an existing workbook...

I decided to add some code and a screenshot. This code will return the number, which lies behind the date, and write it into the cell. So that's not what I want, but maybe the code clarifying what I need anyway.

The screenshot shows the wanted output : screenie.png

View 14 Replies View Related

Change Ddd Formatted Cell To Text String

Feb 17, 2012

How to change a "ddd' formatted cell and change it to a text string (even if you have to use another set of cells)?

I have 3 columns of cells A,B,C.

Column A has dates in it.

Column B has the "ddd" format of the A cells (takes date from A cell and turns it into the day of the week...ex:2/17/2012 into "Fri")

Column C is the one I want to formatt whatever is in the B column into a string, such as "Fri" but with it being text instead of "ddd" formatted.

View 4 Replies View Related

Excel 2010 :: How To Make Concatenate To Generate A Text String Using Custom Formatted Value Of A Cell

May 2, 2014

I have an Excel 2010 spreadsheet that I am using to save several numbers all in the same column. These numbers can range from the several thousands up to billions. The formatting I am using for these numbers is Number (using 1000s separator).

number_forma.png

I am also using the spreadsheet to generate a text string for each of the numbers. I don't want the text string to show the number as it is, I want to shorten the number by only showing the first few digits followed by a "B" for billion, "M" for million, or "K" for thousand. For example, in the text string I want to show 1,600,000 as 1.6B.

In order to shorten the number I use the cell in the column to the right of each number. This cell uses the following custom formatting (which I found by doing a Google search): [>999999999.999]#.0,,,"B";[>999999.999]#,,"M";#,"K";

custom_format.png

As you can see the formatting is quite complex (at least for me it is) but it does what I want it to do.

Here is a screenshot of what the original and custom formatted cells look like:

custom_formatted_cells.png

As you can see the custom formatting works and does exactly what I wan

The next column (after the custom formatted number) is where I put the generated text string for each of the numbers. As I stated above, I want the generated text to use the shortened version of the number (e.g. 1.6B).

To generate the text I use the CONCATENATE function with a reference to the cell containing the shortened number as one of the arguments. For example:

CONCATENATE("SOME STRING ", B1)

Where B1 is the custom formatted cell.

The problem I am running into is, the text that gets generated doesn't show the shortened format of the number, it shows the full number. Here is a screenshot demonstrating what is happening:

concatenate_formula.png

As you can see the generated text is "SOME STRING 1600000000". This is not what I want. I want the generated text to be "SOME STRING 1.6B".

I think I understand what's going on. When the CONCATENATE function references a cell it takes the actual value of the cell and ignores any formatting. (I suppose formatting is just the way you see the data, not how underlying functions receive the data.)

My question is, how can I re-write the CONCATENATE function (or use another function, etc. available to me) to use the formatted version of the cell?

*UPDATE* I have attached my spreadsheet as an attachment to this post (tackyjan_excelforums.xlsx). Please note that it was created and saved using Excel 2010.

View 8 Replies View Related

Date Isn't Formatted With VBA?

Aug 6, 2012

I have a strange issue. I have column "B" has date texts in it ( don't know if it means value) like 21.09.2012. The cells are in text format.

VB:
Sub ReFormatCell()
Range("B:B").Select
Selection.NumberFormat = "dd.mm.yyyy ddd"
With Range("B:B")
.Formula = .Value
End With

I tried ".Value = .Value" or ".Formula = .Value" or Copy paste or offset...... Non of the codes didn't work to make date format as I desired :/

The order is something like:
1. Format column "B" as text.
2. Offset text value 21.09.2012 to B.
3. Reformat cell as date
4......?!?!

What should I change to display "21.09.2012" as "21.09.2012 Wed" in B:B range?

View 9 Replies View Related

Adding Formatted Date To A Messagebox

May 3, 2007

I have a cell E1 that is actually a vlookup and returns a date. I had to custom format the cell so the value returned looks like "June 2007" instead of "39827". I am running a macro and I need a messagebox to tell the user that they are creating an email for June 2007 (which is really the variable cell E1). Problem is the message gives the date as '6/4/2007' instead of 'June 2007'. I tried using the text() function to format the cell as "mmmm yyyy" but I get a type mismatch error. Below is the code I wrote. The first way shows successful but the date as numeric. The second gives me the type mismatch error: First way:

a = Range("e1").Value
Msg3 = "You are about to create an email for " & a & ". Are you sure?" 'Define msg
Style = vbYesNo + vbQuestion + vbDefaultButton2 ' Define buttons.
Title3 = "Create new file" ' Define title.

Response3 = MsgBox(Msg3, Style, Title3)
If Response3 = vbYes Then ' User chose Yes.
'create email

Second way (mismatch error): a = text(Range("e1").Value, "mmmm yyyy") Msg3 = "You are about to create an email for " & a & ". Are you sure?" ' Define message.
Style = vbYesNo + vbQuestion + vbDefaultButton2 ' Define buttons.
Title3 = "Create new file" ' Define title.

View 2 Replies View Related

Dates Are Not In Same Format Even Though Both Cells Are Formatted As DATE

Oct 17, 2013

I'm working with a big dataset and the dates come out in this way:

94WAO7t.png

EDIT: Example of book included

View 10 Replies View Related

Formula To Return Sheet Name Not Formatted As Date

Jan 13, 2010

I have the following formula in cell B1 to return the Sheet Name as the cell value ...

View 6 Replies View Related

Converting Date Format In Formatted Column

Oct 9, 2013

I have a column that contains dates from our system that displays in "mmddyyyy" format (i.e., 10121999 or 8121998). How do I convert this to a 10/12/1999, 8/12/1998 formatted column?

View 1 Replies View Related

Text And Formatted Date & Time In Cell

Mar 19, 2008

I am trying to get a single cell to display the following:

Last Updated: 3/18/2008 15:08 (GMT+2)

Entering =NOW() in a cell displays the date and time as required.

But entering ="Last Updated: "&NOW()&" (GMT+2)" displays the date and time as a serial number. Formatting the cell to Date does not change the serial number to date and time format.

The only way I have found to get the desired result is to use =NOW() in another cell (F13), format that cell to general to get the date/time serial number, then use ="Last Updated: "&TEXT(F13,"m/d/yyyy h:mm ")&" (GMT+2)" in the required destination cell.

As I said this works, but it strikes me as an inefficient method. Is there a formula I can enter or formatting I can apply to get the desired result without using an addition cell?

The result needs to be in a single cell. Splitting text and date/time into 3 adjacent cells will not work with my worksheet setup.

View 9 Replies View Related

Datedif But For Date In Future And To Return Formatted Time Value

Aug 4, 2009

I need to calculate the difference in Years, Months and Days between:

Date 1 = TODAY()
Date 2 = 4 years after a date in cell A1, which will always be earlier than today's date

(A bit of backround - I have certain risk management procedures that have a lifespan of 4 years. I want to calculate the time between now and 4 years after the date the procedure was completed, essentially to see how long before they have to be redone).

So far I have:

=DATEDIF(A1+4,TODAY(),"y")&"y "&DATEDIF(A1,TODAY(),"ym")&"m "&DATEDIF(A1,TODAY(),"md")&"d"

But that returns #NUM!.

Removing the +4 obviously just calculated the difference between the date in A1 and today, but I need the date in A1 PLUS 4 years and today.

I have also tried:

=(DATE(YEAR(A1)+4,MONTH(A1),DAY(A1))-TODAY())/365.25

which works in theory, however:
a) no consideration for leap years
b) does not return nY, nM, nD - only the decimal.

However I would be happy to use this method if I could convert it to Years Months Days.

View 11 Replies View Related

Date Conversion Formula For Dates Formatted With Period

Aug 19, 2012

How to create the formula for dates formatted with periods.

Dates are as follows:

01.07.12 - should return as 1-Jul
01.08.12 - should return as 1-Aug
02.08.12 - should return as 2-Aug

View 4 Replies View Related

Message Box Show Specific String

May 27, 2009

I need to refer the LAST ROW OF COLUMN "D" to appear in the message box for the below code along with " Receipt number" which is in Sheet2.

Sub saveit()
With Sheets(2)
r = .Range("B65536").End(xlUp).Row + 1
InvN = Cells(15, 4).Text

If Range("c18") = "" Or Range("c20") = "" Or Range("c20") = "" Or Range("c24") = "" Then
MsgBox "Please fill all required fields", vbCritical, " Missing data"

Exit Sub
End If...............................

View 9 Replies View Related

Cell To Reference Just The Month From Another Date-formatted Cell

Nov 11, 2009

I'm trying to link two different budgets into a third spreadsheet. The final step I'm attempting to accomplish is have an if-and statement reference just the month from a date-formatted cell. One of my departments tracks their budget on a daily basis, i.e.
11/2/2009, 11/3/2009, etc. rather than just 11/2009. I want the if-and statement to return the budget from all days in a given month so i can apply the formula to the whole year, broken down monthly too. I saw a question similar to this one but didn't see any responses so I'm not sure if it can be done.

View 6 Replies View Related

Convert And Format Date Time String To True Date Value

Oct 19, 2012

I have a spread sheet with a date colume that reads: 2012-06-27-19 I need to have this read like 06/27/2012 but nothing I do is working I have tried to go to the formatting process and backing the hr:mm out and that doesn't work. I really don't want to go line by line to manually correct this issue.. HENCE ... over 2000 lines

Second question: If I have a column that reads 02/15/2012 and another column that reads 3/27/2012 how to a format a 3rd column to make it read total number of days between 1st date and 2nd date?

View 1 Replies View Related

How To Convert Date (text String) Into Date Format

Jan 17, 2012

I have these as input entered as text:

January 01, 2011 January 01, 2011 February 28, 2010 May 12, 2011 June 02, 2010 February 28, 2010 May 12, 2011 June 02, 2010 February 28, 2010

but I need it in this DATE format:

MM/DD/YYYY

I need it as a formula to be entered into a cell in excel (not VBA)

View 9 Replies View Related

Warning Message Box For Date Entry

Aug 15, 2006

I am writing a roster spreadsheet and it has cells with drop down lists using validation lists to fill in the start and finish times, as we run a nearly 24 hour business it is possible to accidently start someone at 2.00am and finish them at 10.00pm. In the cell which calculates the time rostered I want it to display a messagebox if the hours exceed 10 hours or go into negative.

I need to "wife proof" this sheet as this stuffs up the total calculated hours and total costs.

Would I do this through validation on the cell with the formula calculating the times orr though a macro on the sheet module?

View 3 Replies View Related

Show Message If Completion Date Not Met

Aug 28, 2007

I have a spreadsheet where I have input all of my technicians service calls and installations.

In Column C Row 5 and up to the max I assume because I'm not sure how many rows I would use in a year, I have an estimated completion date.

In Column D and the same Rows as above I will input the Actual Completion date.

What I want is if the current date is past the estimated completion date (Column C) and there is no date entered in the Actual Completion date (Column D) I would like a MsgBox to pop up saying "Please enter a new completion date on row _"

"_" would be which ever row the estimated completion date has expired without an actual completion date being entered.

View 9 Replies View Related

Popup Message If A Contract Date Expires In Three Months

Jan 5, 2010

Is it possible to have an automatic pop up (warning) message if the (contract) date (in cell U3) expires in three months. In the message should also be mentioned the contents of cell A3 + the contents of cell K3 + the contents of cell U3. I don't want to use conditional format but need to show a warning.

View 9 Replies View Related

Extracting Last Date From String

Apr 21, 2014

I have been trying to extract dates from strings.

The formula I have currently works however I've found that sometimes there are two or more dates in the string (at which point I'd like to extract the last date (appointment date)).

View 2 Replies View Related

Extract Date Only From String

Jul 2, 2010

What I want to do is extract the date only from a string of text in a cell and put it in the cell next to it. The date is not alway in the same position within the text string and although similiar, the text string can differ. There are around 6000 lines in the sheet, I've pasted 4 as an example below.

THE BIG COMPANY LTD 15312178 COLLECTION 14.12.09
The Small Company Ltd 19073864 COLLECTION
DATE 17/05/10 511438 511437 511436 ORD LE
The Medium Size Company 19080948 COLLECTING WEDS 26/05/10
The Very Good Company 19149554 COLL DATE:28.06.2010 175 PEA PARK ROAD Z7 9AB

View 9 Replies View Related

How To Extract Date From String

Jul 17, 2013

I want to extract date from string My dates are going to increase every 9 days. as you can see in table given bellow. And goes till Wk52

Wk1-> 02-Jan-11
02-Jan-11
Wk2-> 09-Jan-11
09-Jan-11
Wk3-> 16-Jan-11
16-Jan-11
Wk4-> 23-Jan-11
23-Jan-11
Wk5-> 30-Jan-11
30-Jan-11

View 2 Replies View Related

Convert String To Date

Aug 2, 2013

I have a field in the format of 121031. I need a formula to convert this field to a date DD/MM/YYYY format, so 121031 becomes 31/10/2012.

View 9 Replies View Related

String & Date Data

May 12, 2007

I have two variables 1st is a ETD (Estimated Time of Departure), ie 0510 which is string. 2nd is a KRT (Kitchen Ready Time), ie 03:00 which is date, time.

I need to put these two items in a cell as string, ie 0510 03:00

I tried .cells(rowindex, column) = me.etd & " " & me.krt
and I get 0510 0.1223243

then I tried

I tried .cells(rowindex, column) = me.etd & " " & format(me.krt,"hh:nn")
and I get compile error: expected function or varible

So how do I set the KRT to "hh:nn" and combine it with the string ETD to show 0510 03:00

View 9 Replies View Related

Concatenate String And Date...

Apr 12, 2007

when i concatenate two cells (the word "excel" and today's date), i get
excel 39183...? i would like: excel 4/11/2007

View 2 Replies View Related

Reformat Date String In Vba

Jul 3, 2007

I m trying to use a variable that is declared as a range in a formula. GroupCategory is the name of the sheet its getting the data from. I want to use myRange instead of actually putting in the range. I know there's something wrong where I highlighted in red.

Sub AAmacro()
Dim myRange As range
Lastrow = Cells(Rows.Count, 1).End(xlUp).Row
Set myRange = Range(Cells(2, 1), Cells(Lastrow - 1, 1))
Sheets("sheet1").Select
Range("L2").Formula = "= SUM(INDEX(GroupCategory '!' & myRange,,MATCH(C1,GroupCategory!$A$1:$ AI$1,0)))"
End Sub

View 4 Replies View Related

Extract Date And Time From A String

Feb 19, 2014

I have this data & would like to extract the date in dd/mm/yy and the time stamp separately to use in some calcs.

Jan 10, 2014 4:47 AM
Jan 10, 2014 4:47 AM
Jan 14, 2014 4:30 PM
Jan 15, 2014 4:00 PM
Jan 16, 2014 5:01 PM

View 10 Replies View Related

String Of Dates Convert To From And To Date

Mar 12, 2014

I have a spreadsheet with reference relating to dates that are listed as single days. I am trying to convert the single dates relating to a reference to a from and to date but i'm having problems.

Example

048051_14110/09/2013
048051_14111/09/2013
048051_14112/09/2013
048051_14113/09/2013
041929_14115/10/2013
041929_14116/10/2013
041929_14117/10/2013
041929_14118/10/2013

I want this to read

048051_141from - 10/09/2013 - to - 13/09/2013
041929_141from - 15/10/2013 - to -18/10/2013

View 1 Replies View Related

String And Today Date In The Same Cell

Mar 21, 2014

I'm looking to combine today's date and a string in the same cell. This is what i've come up with:

The problem is that this gives today's date in a numerical value rather than in "short date" form like I want. If i format the cell as a date it doesn't change anything.

Whatever the method, for what I'm doing it has to take place in on single cell.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved