String To Time In Formula

Oct 2, 2007

I have a formula in VB code that is like this

sheet1.cells(irow,asktimecol)=asktime

when i place the cursor over each element i get :

irow="9"
asktimecol="5"
asktime="13:30:00"

so it reads

sheet1.cells("9","5")="13:30:00"

but iget the the error
application defined or object defined error
this is saying it cant place the asktime to cell
I have to bring the time thru as string as it come thru as one

View 9 Replies


ADVERTISEMENT

Time To String

Mar 17, 2007

I am converting minutes to [h]:mm (thank you DaveR (UK) for this part)

The formula bar shows:
1/1/1900 11:51:00

The cell contains:
35:51

Is there a way to convert the 35:51 to a string and not time?
(changing the cell format to general after the 35:51 is placed gives "1.49375" which is the time in its raw format)

Sub test_time_2_String()

Dim a As Variant
Dim b As Integer
Dim c As Variant
Dim d As String, e As String, F As String

Cells(10, 21).Activate ' Arbitrary cell

' Break it down to its smallest parts in order to watch the progression

I Dimmed d, e, & F as strings yet it still formats the cell as time as soon as it's pasted.

The ActiveCell.NumberFormat = "[h]:mm" line is there so a least I have 35:51 instead of 35:51:00. Neither General or Text formats worked.

View 4 Replies View Related

Note Last Time In String

Jan 12, 2009

What I am looking for is whether or not there havebeen at least three, uninterrupted true cells in that particular column. The time is based off of the last time in that string that the cell returns a true statement. For example: O-Data returns 12:46:00 PM because there aren't any true statements in any of the other three columns between 12:43:00 PM and 12:46:00 PM and there are three true statements in that column.

M-Data does not return a time at 12:42:00 PM, because at 12:39:00 PM there is a true statement returned in the L-Data column (This is what I mean by interrupting a string).

View 14 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

Formatting Number String To Time?

Feb 20, 2014

I have a mapping program that uploads data with the date and time but when it exports it the time is converted to just a number string, e.g. 15:12:37 becomes 151237000. Is there way to eliminate the last three zeros and insert a ":" between the second and third, and fourth and fifth characters?

View 8 Replies View Related

Time As A String And Converting To Seconds

Jan 25, 2008

I have an ACD program that gives me a time in "mm:ss" format, or in ":ss" fomat. I have 2-3 problems with charting this data.

1 I am inheriting the production of charts from someone else, with old data being displayed by seconds only I am supposed to keep this display.

2 the data that is in mm:ss format is recognized as being in full date format, for example 2:14 is recognized as 2:14:00 AM instead of 2 minutes, 14 seconds.

3 the data that is in :ss, ie :44, is recognized as a string.

Any thoughts on how I can convert both cases to a integer seconds? I know for example that I could mid() the second condition, but I am stuck thinking about the first condition.

I can't adjust the way the time comes in, unfortunately. It is an auto-generated export of the data from a switch.

View 9 Replies View Related

Removing Seconds In Date / Time String?

Sep 26, 2013

I need a macro, if possible, to remove the seconds in a date/time string.

I can format the cells to remove the seconds, but the actual value still contains the seconds. For example:

The cell shows 9/24/2013 19:21 but the formula bar shows 9/24/2013 7:21:17 PM.

I need to remove the seconds so I can us the time in an averageifs formula as a criteria.

I would like a macro because I want to do other manipulations of the spreadsheet with the idea of importing the data at some point into a database.

If I can automate it, or at least decrease tha amount of time I use to get the data in the correct format.

View 4 Replies View Related

Formula To Calculate Time Allotted Minus Time Used And Show Difference In Hour And Minutes?

Apr 27, 2014

Formula to calculate time allotted minus time used and show the difference in hour and minute.

View 1 Replies View Related

Count Number Of Time A Text String Appears

May 25, 2007

I have a very large spreadsheet and want to count the number of times a particular text string shows up in a column. I can't use autofilter due to the 1000 limit.

Here's an example, Column C contains:
Dan Parker
John Doe
Dan Smith
Jill Smith

So if I search on *Dan*, the function should return a count of 2.

I've used COUNTIF before to return values when the whole cell = a certain value but in my case the cell may have 200 characters and I want to count based on a fuzzy search. I would like to do this in a function and not a macro.

View 14 Replies View Related

Run Time Error 1004 (find The Cell That Contains The String )

Dec 14, 2008

I'm trying to find the Cell that contains the string "Grand Total" along row 5.
The following code is giving me Error 1004

Dim column As Long
column = 1
Do Until ActiveWorkbook.ActiveSheet.Cells(5, column) = "Grand Total"
column = column + 1
Loop

The "Do Until ActiveWorkbook.Activ...." line is highlighted in Debugger as the problem line.

View 2 Replies View Related

Join Date And Time String And Keep Cell Appearance Same

Aug 23, 2007

I am joining two cells together, date and time.
I1 & J1
12/13/2005 12:35:00 PM

I want it to appear as
12/13/2005 12:35:00 PM

but after joining i get the serial value of:
38699 0.524305555554747

View 9 Replies View Related

Calculate Time With If And Formula When Time Passing 12am?

Jul 1, 2012

I have a problem here:

Eg.
A B C D E F G H I
1 8 pm 9 pm 10 pm 11 pm 12 am 1 am 2 am
2 8 pm 11 pm
3 8 pm 2 am

I typed a formula : =if(and(c$1>=$a2,d$1

View 4 Replies View Related

Code That Counts Number Of Time String Occurs In Column?

Jul 5, 2014

I need a code that search through a column, counts the numer of times a string occurs and creates on another sheet the unique string and the number of times it occured.

e.g

I have this columns in a worksheet

s/n name company trainer
1 ball Dell Mk
2 doll Msed Kl
3 kol Dlink Mk
4 ball Msed Cl
5 Koll Dell Gl

I need the result to appear on another worksheet like this

Name NumberofTraining
Ball 2
doll 1
Koll 2

View 9 Replies View Related

Comparing A String To Values In An Array Resulting In A Run Time Error 1004

Jul 15, 2009

This workbook is designed to prompt the user with inputboxes allowing them to enter a name, hyperlink a file to that name, and then a date. Next all the drawing names are read into an array and stored. Along with some minor sheet formatting, this is what happens when the button "Add Drawing" is clicked.

Next, when the button "Revise Drawing" is clicked, the user will be prompted with an inputbox for a drawing name. This name will be compared to the names in the array. If the name is found, the row containing that drawing will selected and the user will be prompted to update the hyperlink, then the "drawing date" will be moved to the right by one column, then the user will be prompted for another date replacing the date that was moved. The first sequence of commands or button works fine. The button "Revise Drawing" prompts the user with the inputbox requesting the revised drawing name, then develops the runtime error 1004.

View 3 Replies View Related

Time Formula: Input The Arrival Time Of A Car

Feb 18, 2007

when i input the arrival time of A Car, the time he arrives late appears in column D it should read 15 Minutes. how i can get this time to appear automatic after i have registered the arrival time. A Car due at 19:00 arrived at 19:15. 15minutes late. I would be grateful if you could lead me in the right direction.............

View 3 Replies View Related

Date/Time Formula: Pick Up A Date With Time Entry On A Worksheet And Place It Into A TextBox On A UserForm

Jun 17, 2006

I am attempting to pick up a date with time entry on a worksheet and place it into a TextBox on a UserForm. Format on the sheet is mm/dd/yyyy h:mm AM/PM. The UserForm is placing the value as mm/dd/yyyy 12:00 AM. here is the

Private Sub UserForm_Initialize()
If Not Range("dDate").Value = "" Then
TextBox2.Value = Range("dDate").Value
TextBox2.Text = Format(DateValue(TextBox2.Text), "mm/dd/yy h:mm AM/PM")
Else
TextBox2.Value = ""
TextBox2.SetFocus
End If
End Sub


"dDate" is the named range where the date is sitting. The format is also set on the TextBox2 exit event. Can anyone see why only the date portion is being transfered with the default 12:00 AM for no time component of the value?

View 3 Replies View Related

Working Time And Over Time Formula

Oct 7, 2006

d9 is where i enter my start time from a drop down menu and
d10 is where i enter my finish time

what i would like to do is have a formula to work out my total hours work then minu 45min and tell me whats is remainig which is over time

example

i start work and 06:00 and finish work at 15:00 which is 9hours i then remove my 45min break which then give me 1/4hour (0.25 of an hour) as over time

the 0.25 is then timesed by a figure of say 13.4481 which would then tell me that i have earnt 3.362025

and so on eg if i have 0.5hour it would tell me what that work out as.

View 14 Replies View Related

Formula To Add Time When Time Exceeded

Oct 28, 2013

I need formula (not VB) that will add time (0:30 minutes to each working shift) when these times are exceeded:

11:00
+0:30

19:00
+1:00

35:00
+0:30

[Code] .........

View 9 Replies View Related

Formula From String

Mar 22, 2007

I have a formula in a string, like "5,6889*0,11^3 ..." and I would like to insert it as a formula into a cell or just to get the result into a variable. I have tried

ActiveCell.FormulaR1C1 = "=" & String Or
ActiveCell.FormulaR1C1 = String (With the equal sign already In the String)

but it doesnt work.

When i do it manualy - select the cell in excel, put the egual sign in and paste the formula it works.

View 3 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

Inputbox Value Can Be Compared To A String Variable Or A Numeric Variable At The Same Time

Dec 7, 2008

I am trying to develope a "goto" page macro where the page value maybe 1,34,7A, 256C etc. I am not clear on how an inputbox value can be compared to a string variable or a numeric variable at the same time. This is what I have done, but when the texboxvalue is "7A" it doesn't work.

View 3 Replies View Related

Evaluating A String As A Formula

Apr 20, 2009

Is there a way a string can be evaluated as a formula?

I'm building a formula by concatening several strings but can't find a way to evaluate the formula.

Do I need a macro or is there a simple way to eval it?

View 5 Replies View Related

Interpret String As Formula

Aug 17, 2009

Does Excel have any 'built-in' ability to interpret a string as a formula, or would I need to implement a VBA function? In it's simplest form I am thinking of something along the lines:

Cell A1 contains: 5
Cell A2 contains: "*100"

Cell A4 contains: =Evaluate(A1 & A2)
and hence displays 500

I know evaluate doesn't work, but is there something that does this?

View 4 Replies View Related

Formula To Sum Numbers From A String

Nov 15, 2013

The table below is a portion of a calendar to track vacation and sick time. What I am trying to do is add all the hours of vacation ("V") and sick ("E") time that an employee has used in a cell at the end of each row which represents a month. So there are 31 cells that I need to look in and if it contains V... sum in the vacation cell. There may be a space after the letters and there may not be. They can also start with a decimal.

month
1
2
3
4
5
Vacation
Sick

January
E8
V8
V.5
V6.25
E .5
Sum of V (should be 14.25)
Sum of E

View 6 Replies View Related

How To Put String Formula In Cell Using VBA

Apr 3, 2014

For whatever reason, I don't succeed to write a formula with a string to a cell using vba The char(10) is not accepted

Code:
LimitGainLong_.Formula = "Limit" & CAR(10) & "Profit: " & LimitProfitLongGain

View 5 Replies View Related

Use String-Variable In Formula

Sep 16, 2009

if it is possible, to use a string variable in a Formula via VBA.

For example: ActiveCell.Formula = "=SUM(Sheet3!strVariable)"

Of course the code is not working that way. The Variable has the following structer: CellAdress;CellAdress;CellAdress... so it would perfectly fit into the formula-syntax.

Is there any possible way to do that? The reason behind it is, that I have to deal with a flexible range and I want to process this range with a formula. Actually the range is flexible, because of different filters and I only wanna count all numbers in the unhidden rows.

My varibale would then contain all celladresses, for the visible cells.

So in a nutshell: is it possible to somehow use a varible in a formula?

View 9 Replies View Related

Using A String Variable In Formula

Apr 21, 2006

Just a quick question, is it possible to use a string variable in a Excel formula (in VBA)? Im trying to do the following in VBA

mortgageSchedName = acName & " Schedule"
Range("B6").FormulaR1C1 = "=mortgageSchedName!RC[254])"

the above results in an error because there is no such sheet as "mortgageSchedName", but I want it to access the value of that string variable.

View 6 Replies View Related

String To Cell (Formula)

Jul 6, 2006

I'm having problems with small macro I'm writing.. I'm very close to finishing it but I'm stuck at the end by an extremely small/basic error. What I wan't to do is take a Formula that was generated in a loop and is stored in a string and to output it to a cell on my worksheet as a working formula...

View 9 Replies View Related

Freezing The Formula After Certain Time / Formula Has Been Satisfied?

Aug 7, 2014

I am trying to create a graph of my data at the end of each month. The graph will show a count of the number of instances of each category in the data.

For example:

A1 =TODAY()B1 =MONTH(A1)

Column A from A3 down = 1,2,3,4,W,H,L
Column I between I2 and I140 = multiple instances of 1,2,3,4,W,H,L

July
=IF($B$1=7,(COUNTIF($I$2:$I$140,$A3)),"0")
=IF($B$1=7,(COUNTIF($I$2:$I$140,$A4)),"0")
=IF($B$1=7,(COUNTIF($I$2:$I$140,$A5)),"0")
=IF($B$1=7,(COUNTIF($I$2:$I$140,$A6)),"0")
=IF($B$1=7,(COUNTIF($I$2:$I$140,$A7)),"0")
=IF($B$1=7,(COUNTIF($I$2:$I$140,$A8)),"0")
=IF($B$1=7,(COUNTIF($I$2:$I$140,$A9)),"0")
=IF($B$1=7,(COUNTIF($I$2:$I$140,$A10)),"0")

My problem is that when it comes around to August or the next month, I want the final count of July to be fixed/frozen so it won't change from the 1st of the month. I can then use the July column's data for my graph.

Can a formula convert itself into a value or freeze itself after certain criteria has been fulfilled?

View 7 Replies View Related

Formula To List Characters In String

Dec 23, 2008

I'm using Excel 2007. I want to write a formula that will list all characters in a string to the left of a "-". See below example. What formula would I use?.......

View 2 Replies View Related







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