I get one report.xls workbook by FTP. This book contain date and time in cell A14 in sheet1. e.g. 30-04-2006 19:38:00
I need to have macro to extract only time and paste it to cell A56 in same sheet. How can I do that. The date format is 30-04-2006 19:38:00 and it may be 05/05/2006 7:15 am. Or it could be any type of date format. Please send me how can I work with different date and time format to extract the only time and paste to other cell.
I am using Excel 2013. Anyway, the first issue is that I need to pull a date and a time period from text. So, for example, if I see something like Sunday Prime Time 7/6/14 8:37PM, I would want to pull ONLY the "7/6/14 8:37PM" out of it. Each text box could potentially be different, so it might not always be in the same format as "Sunday Prime Time 7/6/14 8:37PM" it might only show just the date and/or the time without all the extra text i.e. 7/6/14 8:37PM. Some of the cells will have text, others might only have just the time or even just the date and the time. The only thing that I am worrying about in each cell is extracting just the date and time. If this is too much to ask of excel, I would be ok with extracting ONLY the time - 8:37PM and not the date, but I would much rather be able to get both the time and date.
THEN, onto part two of my question. After I would pull the dates and times, I need to compare them with each other. So, when I have the same date with two separate times on that date, I need to write a formula to show if those times on that date are less than 30 minutes apart. So, if I have 6 times on 7/6/14, I need to know if any of them are less than 30 minutes apart.
I would need to have the formula say something like "Problem" if the times on 7/6/14 would be 5:30PM, 5:48PM, 7:00PM, 8:00PM, 8:15PM, and 9:00Pm for example. I would like to see the word "Problem" since 5:30PM and 5:48Pm is only 18 minutes apart, and "Problem" after 8:15PM since that is only 15 minutes past the 8:00PM which is obviously under 30 minutes. The times that are more than 30 minutes apart such as 7:00PM and 9:00PM for example are more than 30 minutes apart from any of the other times that were extracted.
What is the code i need to use to assign a macro to a command button which inserts the current date and time in the selected cell regardless of where that cell is?
I am trying to develop a macro that allows the user to copy and paste a set of date and time values, move them to the next sheet and increase the month by 1. I need help trying to find out how can I create a counter for the program to keep running without the need to reprogram the macros again.
I have cells of data with a long string of numbers such as: 20090507225836. Is there any easy way to convert them to date/time format, such as below? 5/7/2009 22:58:36
If A2 and B2 on Sheet("Master") are not highlighted, copy and paste them into Cell A3 and B3 on Sheet("Job List - Numeric"). Do this up to Row 50 on Sheet("Job List - Numeric"). Once Row 50 is filled, jump to pasting to D3 and E3 on Sheet("Job List - Numeric") and continue up to Row 50 and so on....
I need to do this on one sheet in numerical order based upon Column A and another sheet in alphabetical order based upon Column B.
Here is what I have in code so far:
Sub Final() Application.ScreenUpdating = False Dim c As Integer Dim x As Integer For Row = 2 To 145 Range(ActiveCell, Cells(ActiveCell.Row, ActiveCell.Column + 1)).Select
I have a cell with both date & time "10/9/09 3:15" This is put in the current cell by formula which indexes two dif. cells, Now I am trying to copy this cell and paste into another book but like to have only date. How can I do that? Each time I try it gives me the time value in the pasted cell and I cannot even format it.
I am trying to use and if formula to see if the time on the cell was before a certain time.
The date is entered on Cell A2 - down and I would like to enter a formula in Cell B2 to say if the time on A2 is before 12pm as an example, "Complete" otherwise "Incomplete"
Example 1
Cell A2 : 01/10/2013 13:08:00
Cell B2 formula result: "Incomplete" (Because it was after 12pm)
Example 2
Cell A2 : 04/10/2013 10:05:00
Cell B2 formula result: "Complete" (Because it was before 12pm)
I have a column of times, that are actually dates of 1/0/1900 plus time, from which I want to extract the AM or PM status. I can format it to show this, but it's really just a fraction of a day. I need the actual text "AM" or "PM", not a decimal value.
i currently have a table/template in which external data is pasted... however there are 2 colums titles DATE and START TIME (amongst others) now although where the data is pasted from the information is in the correct format. After the information is pasted both the columns have exactly the same information in them. I'm pretty sertain the only reson for this is that the source the records/data actually comes from formats them on the screen differently to how the records are stored on the database using code....
so after the expanation which hopefully made sense is there any way i could convert a record like this
Thu Jun 28 21:54:33 GMT 2007 (this is how the information is pasted into the 2 columns)
to both
28/06/2007 for the DATE column and 21:54:33 for the START TIME column
the cell format makes no difference because the information is both text and numbers....
I have a mixed list of materials in column 'A'. I have two macro/filters to extract (copy/paste)... one for those ending in "[G]", and one for all others (those not ending in"[G]"), to columns 'B' & 'C' respectively. The code looks like this;
I have cells in a column that record time in date. Unformatted it would appear as 19789.51407 but formatted to show time and date it would as appear as 3/6/54 12:20 PM. I am making graphs with the data and I want the title of my x axis to read "GMT Time (mm/dd/yyyy - mm/dd/yyyy)" or "GMT Time (mm/dd/yyyy)" depending on if the event spans more then one day. Using the following code, it almost accomplishes this.
Dim strDate As String Range("CO3").Value = Range("A3").Value Range("CP3").Value = Range("A" & Drag).Value Range("CO3:CP3").NumberFormat = "m/d/yyyy" If Range("CO3").Value = Range("CP3").Value Then strDate = "GMT Time (" & Range("CO3") & ")" Else If Range("CO3").Value < Range("CP3").Value Then strDate = "GMT Time (" & Range("CO3") & " - " & Range("CP3") & ")" End If End If
Where "Drag" is a variable that signifies the total number of cells in the column; ie the first and last dates. It compares the values and saves the results as a string. The problem is that when the string is saved it saves the date in mm/dd/yyyy hh/mm/ss. How can i separate the date from the time so I can have the title of my x axis appear as i need them?
I have a cell with the following text in it that is being imported from a website "5/1 Smith T win". What i want to do is extract the "5/1" part without it being in the format of a date. I want it to be extracted in the format "?/???". I have entered the following formula to extract the "5/1"
I'm trying to develop a simple time / acitivity capture sheet for a time and motions study. I have a sheet called "Front" with a project number in C2, an activity drop down in C4 and a comments section in C6.
I need to paste these into sheet "Database" into the first blank cell in B:B for C2, C:C for C4 then stamp the date in the same row in D:D and the time in E:E.
The code below adds the date to D:D once the user enters data in B:B and then adds the time when the user selects from a dropdown in C:C. When they have finished the task they enter anything into F:F and then it enters the end time in G:G.
This works well except for one flaw and one modification that I can't get to work. I have found that people retrospectively change the activity in C:C which causes the start time to change. I would like to avoid this hapenning if possible by putting some code in to stop this. Also I would like the times to be related to the push of a button on the sheet and therefore need different code.
Code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub If Not Intersect(Target, Range("B2:B900")) Is Nothing Then With Target(1, 3) .Value = Date
I have a workbook with macro button to run some vba, if i want the button to disable when the user make copies of the workbook (date created is later than original wb saved time) what codes to add in the VBA?
what i assume is to add the time to a cell when the wb is saved, when the wb opens, it check for that cell if the same with the date created, if different, then disable the macro button.
I have a macro that needs a major improvement in performance. I have a Quad Core 2.67GHz single processor computer and with the current logic it calculates 20 values per minute. I have data sets that can be up to 400,000 data points, which means it will take 333 hours. The attached Sample file has over 9000 point. For this data set it takes 7.5 hours.
The core logic of the macro is to extract what I call “Break Point” into column M and “Time Difference” between the Break Points to column O.
I got the code from this forum (thank you DonkeyOte) and made some modifications. The modified logic does the following:
1) The user inputs the starting cell. In the Sample I use G200.
2) From cell defined in button, It moves down one cell in that column and compares that value to the original cell.
If the value is greater than original cell then there are 2 possible outcomes:
a) move down 1 cell in column and if that value is less than original cell, then extract that value and copy that value to the column M (Break Point value) and copy the Time Difference Value to column O. “Time Difference” is calculated as the difference between the 2 point breaks in Column A. In this case I’ve hardcoded 0.003472222 to get 5 minutes which matches up with each incremental time in column A, but I would like the Macro to automatically calculate that by the difference between Column A values. b) move down 1 cell in column and if that value is greater than original cell, then move down again, until find lesser value than original cell. Once we find value less than original cell, extract value and copy value to column M and copy the Time Difference Value to column O.
Once lesser value has been copied to new cell, logic is now: a) move down 1 cell in column and if that value is greater than original cell, then extract that value and copy that value one cell to column M and copy the Time Difference Value to column O. b) move down 1 cell in column and if that value is less than original cell, then move up again, until find greater value than original cell. Once we find value greater than original cell, extract value and copy value one cell to column M and copy the Time Difference Value to column O.
At any point in the process if we find a value equal to the starting cell, we ignore it and the logic continues. The logic continues flip flopping like this to the last value of column G.
OR Here's the logic now in reverse I need:
If after moving down 1 cell of original cell, the value is less than original cell then logic has the following 2 outcomes:
a) move down 1 cell in column and if that value is greater than original cell, then extract that value and copy that value one cell to column M and copy the Time Difference Value to column O.. b) move down 1 cell in column and if that value less than original cell, then move up again, until find greater value than original cell. Once we find value greater than original cell, extract value and copy value one cell to column M and copy the Time Difference Value to column O.
Once greater value has been copied to new cell, logic is now: a) move down 1 cell in column and if that value is less than original cell, then extract that value and copy that value one cell to column M and copy the Time Difference Value to column O. b) move down 1 cell in column and if that value is greater than original cell, then move up again, until find lesser value than original cell. Once we find value lesser than original cell, extract value and copy value one cell to column M and copy the Time Difference Value to column O.
Again, at any point in the process if we find a value equal to the starting cell, we ignore it and the logic continues. The logic continues flip flopping like this to the last value of column.
Once all the Break Points and Time Difference between Break Points are extracted for each value in column G, the AVERAGE, STDEV and MAX values of column O are calculated in column Q, R and S.
There is a loop that controls the execution of the core logic until the last value in column G. In the macro I’ve hardcoded last row being 9171, but I’d like the Macro to figure out what the last row is automatically.
I know this description is a bit long but I’ve worked for many hours on getting it work properly. I just need some help to make it run much faster. I hope someone can help me out on this. I have the right logic, just need the speed now and I really can’t figure it out.
Attached is a sample files demonstrating showing how the logic to flips back and forth as moving down the column starting in cell G200.
The sample shows the results first 4 loops (Rows 200 to 203). The values in M and O are the results of the fourth loop.
Again, assistance is very much appreciated because I've taken this as far as I can with my limited experience.
EDIT - I can embed the Macro, but it'll probably much easier to actually see it in the sample file.
I have this macro listed below that finds all these files, copies cells from stat sheet and places them in sheet1 in another file. It keeps looping till all is found and done.
My problem is when it goes to paste in sheet 1 I want it to shift over a row each time.
Right now during the first pass it pastes in column B, I want it to start in column D
The issue seems to lie right under where it says "Put data into workbook"
Public Sub PullData() Dim wkb As Workbook Dim lngStore As Long Dim strDate As String Dim strName As String Dim Book As String Dim Sheet As String Dim week As String Dim Store As String
is there a way to convert many entries of dates and time entered in the above way into actual dates and times? is it as simple as making a custom format? if so, whats the syntax?
the entries appear to be the year(4 characters), the month (2 characters), the day of month (2 characters), and the time of day (6 characters, AM/PM)
i dont need the time, so the last part ("120000[0:GMT]") isn't necessary.