I've created a useform for recording stock trades. So it asks the user to enter values for
"Date of trade"
"Time of trade"
"Name of stock"
"Price"
Right now I'm using a calendar control I downloaded from
http://www.fontstuff.com/vba/vbatut07.htm and it looks good, but I'd also like to have an easy way for the user to select the time of the trade (in minutes).
Is there an easy way to have a time picker? Like a dropdown box maybe? I'd like to have date and time picked separately since the date will remain the same for a lot of trades but the time will always change.
I've googled it a lot and some people mentioned using the datetimepicker Access add-in but I'm not sure if that's right for me. Also, I'm using Excel 2007 but the form will also be used on excel 2003 machines, will that affect the choice of solution?
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'm creating some userforms for a spreadsheet on Excel 2003 and was wondering if it is possible to have the date field and time field as drop down boxes?
I would ideally like the date field to have 3 drop down boxes (date, month and year) and then the time field to have 2 drop down boxes (hours (in 24 hour time) and minutes).
The date and time would then populate one cell each on the spreadsheet.
I want a drop down calender to choose date from and found that i can use More Controls> "microsoft Date and Time Picker 6.0 (SP4)" for excel 2007 but it doesn't work with other excel and shows a "x" not recognised in some other machines.
I am working on a time table worksheet and I need to insert a time Offset that can range from 5 minutes to an hour with 5 minute increments. The message box or user form will prompt, "How long is your Offset:"
The problem is that I only know how to do make a drop down list that is populated from cells on a sheet. Do I have to use a user form?
The purpose of the attached workbook is to calculate the average number of days a customer takes to pay their invoices. There are two tabs - Invoices and Payments. I am trying to calculate the number of days between Invoices "Sales Date" and Payments "Settlement Date".
The Payments tab is raw data exported from Attache financial system as CSV. It is the best I can get out of the system but the columns are all over the place.
I thought maybe from the Invoices tab I could search a row on the Payments tab to match the invoice number, find the cell containing the phrase "Invoice Number" then pick up the date from the following cell which contains the Settlement Date . This would be straight forward if the data from the CSV file consistently landed in the same column in the Payments worksheet, but it doesn't. As you can see, the phrase "Invoice Number" might appear in any one of several different columns.
I work in school which for example offers 20 courses for every student. Therefore I have a spreadsheet which has students name in A and B then the 20 courses spread from C to V.
Each student will study 3, 4 or 5 of the courses and will have value in the corresponding column (their teaching group) the rest of their row will be blank.
For each student create in columns X, Y , Z, AA and AB I would like to be able to pull from the 20 courses those which the student studies. Therefore finishing up with C to V hidden and just the student names and the 3, 4 or 5 courses they study.
Any ideas? if one method is to get them into one cell how do I get them into the 5 columns; i know DATA : Text to Columns but won't have anything to Delimit it with and can't use Fixed width as students will study subjects with different length charactors.
I have a CSV file which contains a list of records about offices. This CSV file is generated from another program.
I read the CSV file with VBA, a SELECT * SQL statement which puts the elements into an Office Object and adds the offices to a collection.
For some reason, when one of the Telephone numbers is read it is being identified as a Null value. If I manually open the CSV file and change it to a different number e.g. 12345 and try re-read the CSV file with SQL VBA the number gets read fine. Every other element in the CSV file reads fine except for this. The number itself is 7736786460.
Attached is the small snippets of code to read the CSV file which is fairly straightforward.
Code:
Sub LoadUnits() Dim oRs As Recordset Set oFSObj = CreateObject("SCRIPTING.FILESYSTEMOBJECT") 'Open an ADO connection to the folder specified Set oConn = CreateObject("ADODB.CONNECTION") oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & strFilePath & ";" & _
I'm trying to use SUMPRODUCT as a sort of SUMIF/VLOOKUP hybrid. The following formula:
Code: =ROUND(SUMPRODUCT('[12 GB BUDGET 15 V1 LOCAL VERSION.xlsx] Revenue'!$G$3:$FM$3=$K2)*('[12 GB BUDGET 15 V1 LOCAL VERSION.xlsx]Revenue'!$G$27:$FM$27);0)
... should check for the value in cell K2 of the current sheet, compare it to all the values in row 3 of the Revenue sheet, and add up any and all values for those columns in row 27 where there's a match in row 3.
I don't get an error, but it's not adding anything up, either.
I have a excel file with names of employees and projects handled by them. In the 1st column is the name of employee and in the second column, its the name of the project. Every employee has approx 10-15 projects made by them.
I have another file with name of all employees in the 1st column. What is want is to insert the name of any two projects (taken randomly from 1st file) ahead of each employee.
I have Workbook with numerous worksheets,on one particular worksheet i require a formula/macro code that will pick up (say) those cells highlighted in red and then transfer that data set and the other selected information on that row to a another worksheet within the workbook.
E.g Sheet 1 contains columns A to J; Sheet 2 is where i require the information which is highlighted in red to be uplifted and pasted too.
so if Cell B2 contains the highlighted cell how would i uplift and transfer this along with data in cell C2,H2,I2 and J2 automatically to sheet 2.
I have a question that has been bugging me for a long time and an answer to it can be a big timesaver for alot of excel users specially accountants that do account reconciliations..
lets assume that I have 3000 numbers(amounts) listed on an Excel spreadsheet vertically, and i know for a fact that the sum of most of these 3000 transactions equal a certian amount..lets say $1,200,320.23, lets also assume that all these amounts on the list are unique..
now..I want to isolate these numbers(amounts) that add up to that $1,200,320.23 by way of highlighting them or any other method. once that is done, I would be left with the amounts that are causing the descrepency in that account. I wonder if there is any function, utility or even VBA code in excel or even another software that can help solve that problem..I hope my explaination was suffecient, let me know if you need further clarification.
I have a column where some cells are coloured yellow. In another column, I'd like to mark out these cells, e.g. if the cell next to it was yellow, I would like to to display 'Y'.
I have a simple program that picks up an ID on sheet1, finds that ID on sheet2, picks up the information in one cell from sheet2, and brings that information back to sheet1.
The program works fine until for all IDs above row 570. After row 569 something strang happens. The programs is still able to find the ID but when it tries to pick up the one cell value it is saying it is blank yet you can physically see the data is present.
In all my years of VBA programming I have never encountered anything like this. Especially, where things work fine on half the worksheet and not on the other.
I am posting the code below, but I don't actually believe it is in the code. I cannot post the workbook because of the information it contains...
Book, Loaned to, Date A Tale of 2 Cities, John, 1/1/2010 Oliver Twist, Mary, 2/3/2011 Great Expectations, James, 4/6/2011 Oliver Twist, Greg, 6/2/2010
I want to make it such that, when I input the name of the book, it will tell me the person whom I lent it to last and the date of the transaction. Preferably, this should be done without any assumptions on how the table is ordered. For example:
This should be a simple one, But I can get it to work. Could someone advise me as to how I can change this line of code to pick sheet(2) as it is now it picks sheet(1) . and throws the formula off. In A nut shell the formula is looking at sheets(1) C3 When it needs to look at sheets(2) C3. I always get messed up with the & and "" and!
I want to pick the last number entered in column and put it in a formula. Is there an easy way to do this, or do I have to stack a lot of IFs in a string.
I am trying to write a macro that will automate the process of selecting rows from a data sheet. I want the rows to be selected based on the values in two columns. I want to find and select the row at the beginning and end of positions in a column where the values are equal. For a quick example, if my data looks like this below, I'd want to select the entire row for rows 2,3, and 6... I also need the row just before the value in both columns are equal.
I have written this macro and it is not working... are there any obvious problems with this? This is new to me and I'm not exactly sure that I've used the correct commands. It also seems like LastRow is referencing 0 and not 12965 or whatever the last row of filled data is for the sheet.
Sub Deltadata() Dim RowNum As Long, LastRow As Long LastRow = Range("A" & Rows.Count).End(xlUp).Row 'Finds last filled row (should be 12965)
I am trying to get excel to pick a cell from a hiden matrix and showing it on my worksheet. I want to pick the cell using 2 drop down boxes as bellow - 1 drop down picks option on X axis and the second picks using the Y axis and then the coresponding cell in the matrix is displayedMatrix example [URL] Drop downs example [URL]
I need to look at each filename in a particular folder, open the file if the name contains "THO", then modify the file and close it. I know how to open, modify, and close files using VBA. I'm stuck on how to pick one particular file based on the filename. I copied the code below from another thread. It's great for opening all files in the specified directory. Can anyone show me how to modify it so I only open files with "THO" in the name?
Sub OpenWorkbooks() Dim wb As Workbook Dim dirr As String Dim I As Long Application.DisplayAlerts = False dirr = "C:Documents and SettingsHalldaviDesktopKoen's weekly sample reports" With Application.FileSearch .NewSearch .LookIn = dirr .FileType = msoFileTypeExcelWorkbooks .SearchSubFolders = False .Execute For I = 1 To .FoundFiles.Count Set wb = Workbooks.Open(.FoundFiles(I)) Next I End With End Sub
e.g. range("a1").value= 384HK in range("b1"), i would like to have only 384, ignoring the HK
any excel tools or VBA code can accomplish this? there is a bunch of data that comes like this and i just dont have time to retype only the number one by one
The gap between each word and the word "US" is uneven. sometimes it's 3 spacebar apart, and sometimes 4.
I am trying the pick the part not including US. I tried =IF(ISERROR(SEARCH("US",A1)),A1,LEFT(A1,SEARCH("US",A1)-1)). It works but when I use match function to look up the word. It returns N.A. As the output is not just CTAC(4 characters), but 5 characters(including blank). The problem is the gap between between the word and "US" is different for each cell. so I cannot just minus the same character in the above formula (e.g. -2 if there is one blank cell). Anyone can tell me how to pick out the word and with only the number of characters in the word?(no blank)