I have a querytable running on my sql database. In the query I have a trimleft function because the numbers are stored with several proceeding blank spaces. When I execute the query through my macro, everything works fine, except I can't average or sum the results. They can be multiplied, divided, etc, but not averaged or summed (they just show as zero on summing, which makes the average DIV/0). The really strange part is that if I select a number and go to the formula bar and hit delete at the beginning of the number (which actually deletes nothing), the number is suddenly capable of actually performing as a number. I assume this has something to do with how the querytable is returning my results, but does anyone have an idea for a workaround for this issue?
See the attached spreadsheet with a macro that gets the querytable in Sheet1. In sheet2 there is a formula to get one of the balances from the querytable result. Is there a way to find the balance on sheet2 from the querytable at runtime so that I do not have to download it to Sheet1? Then I could do away with Sheet1 altogether.
I am trying to date and time stamp a certain cell. This cell is going to be compared to another cell in another sheet (also date and time) so that I can track deadlines being met.
Even with the number format, the cell is not stamped as a number. As a result I get #value errors when I take the difference between the stamped cell and the cell with the preset deadlines.
I have several sources of information for client files. the number format includes a reference number and a month, eg 123/11, 456/02. In some cases, the numbers may be presented including the company initials, eg ABC/00123/11. I want to make sure all numbers on all sources are the same as I am using Vlookup and this reference no to copy information from one source to another. Sometimes when I change the format Excel sees this as a date, eg 11/11 is 11-Nov, and in some cases Excel sees a fraction, eg 123/11 is 123 11ths or 123 divided by 11.
I can easily take out the reference no with a find and replace FIND ABC/ replace with . But this often results in a number with leading zeroes, eg ABC/0123/06 will leave 0123/06.
We receive about 20 sales files of several hundred lines of data each day from various agencies. I want to create a macro / VBA code which checks that the data submitted is correct so that we can upload it into our database without import errors and / or having to manually check each line of data.
I envisage something like an output report:
##################### 149 entries Column A - Date - OK Column B - Customer_Phone - Errors (Should be 11 digits) Row 21 - Customer_Phone - Error (Not 11 digits) Row 108 - Customer_Phone - Error (Contains letters) Column C - Outcome - OK Please correct and re-check. #####################
What's odd is that if I create the formulas above independent of the specific formula data (O5, P5, and Q5) and just type in numbers, those formulas do exactly what they should. Can I not compare data returned though formula calculations?
I am currently using the Match and index functions to search for specific criteria and return specific data based on that criteria. The problem is the formula is returning the first value at the beginning of the month rather then the end of the month value that I am asking for. I have my criteria set to zero so it should be a perfect match. with the live worksheet I have several tabs for different years. I want to take the end of month balance on each of those year tabs for each month in each fiscal year and add them together. My formula only has the one month because I am unable to get it to work much less adding in all of the years information. I have the employees choosing EOM for the last transaction posted during that month and that calculates the month number in the field next to it. I was thinking I could use the match to look for a specific month in that column and return the balance adjacent to it at that point.
In an excel sheet, I am using a macro to filter. Macro code is as follows. When I run this macro, it returns 4 rows matching the criteria from 560 rows in the excel sheet.
I want to use the same criteria in the vb.net code, to do same thru vb.net. But, when I run the same code in vb.net, it just returns only 1 row (1st row only).
I have a spreadsheet which needs to display currency in the correct format dependant upon whether a contract is in English or German Law. Excel defaults currency format as €310,000.00 however in German this needs to be €310.000,00 i.e. with the decimal point and comma in opposite positions. Does anyone know what expression I can use to format it as the latter?
I have a question regarding Do While loops. I'm trying to write a do while loop to search through an array for a particular value and return the row number. This value is in the first column of the array and there are 211 of each value chronologically sorted. So, the first column from top to bottom reads 1,1,1,1..211 times, then 2,2,22,..211 times and so on. For this case, I want to return the first row where a particular value is found.
I have been trying to find an easier way to make sure that the email address that I have been given in a excel workbook are in the proper format before I try to use them. I have tried doing a google search on this subject but have not found the correct solution. I want to enter a function in column L that would use a regular expression for the email format and compare it to the email address in column J. If the results are true place a value of 1 in column K. If false place a value of 0 in column K.
When I import data , the dates appear as follows in Col G sheets "Imported Data"
If I select Col G and use Text to columns and select mdy, it gives me the dates in the correct format. However, If I use the macro recorder to do this and then run the macro, it does not work
I have attached the dates after using text to Columns wjhich is the correct format.
Imported Assets  G201/07/2006301/02/2007401/02/2007501/11/2008601/01/1985720/11/1990801/01/1985901/01/19851001/01/19851101/01/19851225/09/19921301/02/19931401/05/19931501/06/19931601/08/19931701/01/19941801/09/1995
We have a system that normally dumps our data in the format of column K, with all of the data in one column and the same spacing you see below in red. The problem is when the system is slow, we have to manually dump it, and when we manually dump it, it comes out spread out from column A to column I. For the macro to work without bugging out on me, it has to be in the same format as column K, with exactly the same spacing.
I have tried text to columns while importing, amongst other things, but have not had any luck. So in a nutshell I need to be able to make column A thru I, look just like column K with exactly the same spacing. The data dumps are different every day.
I have a strange feeling I will not get a reply on this question, because it is so strange, or that I failed to articulate it correctly....
I have a spreadsheet with five cells (L3 - L7) that have dates entered into them in the format of 9/9/2013, 9/10/2013, 10/20/2013, 10/21/2013, 10/22/2013. In another cell, cell n2, I have the formula:
In cell n2 I get: 41526415274156741568481569 This is the excel number for the above dates, but I need it to look like:
Sep. 9 - 10, 2013, Oct. 20 - 22, 2013
I also need it to be able to isolate single dates for example if the date in cell l5 was 10/5/2013 instead of 10/20/2013 then I would want n2 to look like Sep. 9 - 10, 2013, Oct. 5, 2013, Oct. 21 - 22, 2013. but my formula currently only changes that number in the string from 41567 to 41552.
The reason I need this is because this information is part of a identifier and also maybe used in reports, the people reading the reports won't know this long number is actually dates and won't be able to read them if they did.
Also the cells L3 - L7 data depends on cell l2, 1 = one date entered into cell l3, 2 = two dates, one in cell l3, the next in cell l4, and so on for up to five total days that may or may not be consecutive. Also, it seems to work as is, but only for one day.
I have the following code to ensure user inputs date in correct format, but on test it doesn't capture if they enter 11.12.08 (Which we have had people do before), if that is entered the textbox returns 30/12/99, is there a way I can prevent this?
Private Sub txtStartDate_Exit(ByVal Cancel As MSForms.ReturnBoolean) 'Checks Start Date is in correct date format If IsDate(txtStartDate.Value) Then txtStartDate.Value = Format(DateValue(txtStartDate.Value), "dd/mm/yy") Else MsgBox "Please enter a valid date format." Cancel = True End If End Sub
I have a form on which I select a date (using a calendar form) and on the form it works perfectly. The date is in the correct dd/mm/yyyy format for example (03/04/2013 - 3rd April 2013), I then insert this date into a worksheet and it comes out in the correct format, but it is actually turning the dates around so where it should be putting 3rd of April (03/04/2013), it's inserting 4th March (04/03/2013) instead. It looks very much like the form sees the date in dd/mm/yyyy format and the worksheet when taking the data from the form thinks it in US format (mm/dd/yyyy).
I have a csv archive file on a remote server that I am accessing with excel. The problem, if I use QueryTable, all info is placed in the first column. If I use the workbook.open method, the info is placed in the proper cells, but it is in a seperate workbook.
So, how do I get the workbook.open results, except in the active workbook/worksheet? Or, is there a way to QueryTable (my preferred method) and get it into seperate cells?
I have the following code which works but is slow. All the code is the same except the address part and the destination range. Any help simplifying would be great. Also, every time I run the sub it asks me if I want to replace the destination cells. Is there any code to circumvent that? Lastly, although the second and third query requests have a different destination range, excel shifts the previous query to the right, hence first command after final query request.
When a QueryTable is refreshed and the number of rows it returns changes, I *expect* that a corresponding Named Range should be automatically resized. The sheet-level Named Range (same name as the QueryTable) should cover the query result's header row and all returned data rows.
But now I've got a Named Range that seems to have become disconnected from its QueryTable. The query returns fewer rows but the Named Range stays the same size.
This is even more perplexing because the aberrant QueryTable is right next to another QueryTable that is behaving normally. The Data Range properties of both are identical.
How do I handle URL connections - such as logging into a web application?
Example 1 When I use .Refresh BackgroundQuery:= False and there is a problem connecting, Excel hangs ... cannot Ctrl-Break ... only option is to kill Excel (and lose changes). global QT As QueryTable Set QT = ActiveSheet.QueryTables.Add(Connection:="URL;" & vLoginURL,
[Code]....
Now, if it's still refreshing, it's ok. But if not, it gets stuck on .Refreshing with run time error 424.
Ideally I want to use .Refresh BackgroundQuery:= False as I am calling a number of urls. I just need to provide an "out" when the url fails and hangs on .Refresh BackgroundQuery:= False
I am working on a spreadsheet that deals with times such as a work schedule, how every the schedule cells are in a time format, and my if function will only return "check"(which is false). my code works if it remove the time formatted cells but i want to keep the document in its orginal format.
I need the names of students from Summative tab in the correct box based on how many question they got correct. (Q 27-32, (0-1, below, 2-3, Average, 4-5, Above Average, 6, Excellent Performance. ) I have attached a file.
On the "Master" tab, I would paste in the newest information received from our system weeklywhich is around 2600 rows. I want to then compare the Master sheet to the other tabs and if there is a new Serial Number present in column I, then add that row of data to the next available row at the bottom to the correct tab.
The Orange tabs Fleet Volume PC, Fleet Volume BW, Fleet Volume Duplex will house all countries and all serial numbers but Fleet Volume Color tab will only have Color Serial Numbers for all countries, column J on the Master tab.
So, the same will goes for the USA Volume and CAN Volumes tab, only those serial numbers for that country will falls in these tabs and color only will go in the color tabs. There are 14 other tabs missing from this workbook with other countries, just removed to keep size of file within limits.
From my workbook, rows 29 to 33 on the Master tab are new serial numbers.
Also, I want to highlight the data on the Master, after comparing this Master tab to the other tabs and within the Master highlight in yellow the cells that have new updated information!
I have a bunch of workbooks that are used to capture information about implants used in surgical cases. I use a small VBA process each morning to update a querytable which contains all of the core patient information for future cases, however it is not working properly. The code goes through the process OK, or so it appears, opens and closes each sheet, and saves them appropriately, but the query table doesn't seem to refresh no matter what I do.
Sub RevisedRefresh() Dim lCount As Long Dim wbResults As Workbook Dim wbCodeBook As Workbook Application. ScreenUpdating = False Application.DisplayAlerts = False Application.EnableEvents = False On Error Resume Next Set wbCodeBook = ThisWorkbook With Application.FileSearch .NewSearch .LookIn = "G:SHSTheatreCommonReceptionImplants" .FileType = msoFileTypeExcelWorkbooks If .Execute > 0 Then For lCount = 1 To .FoundFiles.Count Set wbResults = Workbooks.Open(Filename:=.FoundFiles(lCount), UpdateLinks:=0)...............................
Above formula, in cell E8 is the number 3, however excel does not recognise this and returns 1. is there a way i can get E8 to see that it is a 3 in that cell and return the correct number of rows downwards in my table?
I'm trying to create a formula that will added the correct amount in the correct cells, I have create a dunny sheet in trying to achieve this. If Cell B8:B11 = ABS or Dum that any points won should be added to Cell L8:L11 right now its adding it into K8:K11. If Cell B8:B11 = is Blank any player points should be added to cells K8:K11. I'm using this formula throughout cells K8:K28 =IF(J8>J25,1,IF(AND(J8<>0,J8=J25),0.5,0)) Any thing in red is incorrect anything in blue is what I'm trying to achieve.