Speed/Efficiency For If-Else Construct
Apr 21, 2009
My question is about the If-Else Construct.
I often write If-Else statements that require an action be taken only if something is true. If that something is false, no action is to be taken.
My question is, how do you code "no action".
The following is what i usually
View 5 Replies
ADVERTISEMENT
Jan 29, 2009
I created a macro that checked a cell for invalid numbers. There were 6 I checked for: #REF, #NUM, ####, #Div/0, #N/A, #Null. Because you can only compare two "phrases" with OR, I had to write it like this:
View 12 Replies
View Related
Feb 13, 2009
construct a SUM formula. Have a problem with this macro:
View 5 Replies
View Related
Jul 12, 2007
If there is either a 1 or 0 i cell A1 what is the most efficient =IF(A1=1;B1;C1) or
=A1*B1 + (1-A1)*C1? Or perhaps their are something even more efficient??
View 4 Replies
View Related
Jan 10, 2010
I've got a formula in my spreadsheet that is quite lengthy. I could use an array formula to replace this formula...but I don't know how to construct it. Below is an example of my current formula:
View 4 Replies
View Related
Oct 22, 2008
I want to construct a calendar in 7 columns; all Mondays of the year to be in the first column headed "Monday", all Tuesdays of the year in the second column headed "Tuesday" and so on till the last column headed "Friday" containing all Fridays [ignoring the month titles].
View 8 Replies
View Related
Feb 20, 2007
I use the applicaiton timer but it said time is 5 so what's the problems? Below i want to change to case construct.
Sub GreetMe()
If Time < 0.5 Then
MsgBox "Good morning!" & " It’s now " & Time, , “The Time”
ElseIf Time >= 0.5 And Time < 0.75 Then
MsgBox "Good afternoon!" & " It’s now " & Time, , “The Time”
Else
MsgBox "Good evening!" & " It’s now " & Time, , “The Time”
End If
End Sub
this is what i did so far but still having problems with it with case construct
Sub GreetMe()
Dim morning As Integer
Dim afternoon As String
Dim goodevening As Integer
Select Case morning
Case Application.AutoRecover.Time < 0.5.......................
View 3 Replies
View Related
Sep 18, 2007
It is to large to upload here and I have removed the sensitive data that would normally be present. The part I'm currently stuck at is the multiple search criteria, one part works while the other does not. Also, I have yet to discover a way to indicate to the user that the correct Row is selected and being edited in the right cells.
View 2 Replies
View Related
Apr 27, 2014
I run a rather simple loop (see below). But as it runs through A1 to A28000 it takes a lot of time. Is there a more efficient loop to operate this simple task?
View 9 Replies
View Related
Feb 21, 2008
How can I construct a polar plot in excel 2007, I would like to plot the following:
Gain (modulus) è° (argument) 1.688 -35.94 1.43 -86.4 1.125 -130.6 0.95 -156.76 0.747 -191.86 0.607 -223.24
View 9 Replies
View Related
Sep 1, 2009
how to reduce formula size/improve excel efficiency?
I have a really complicated formula with lots of COUNTAs, VLOOKUPs, IFs, etc etc etc which returns a variety of values, ZEROs (for blank cells being referenced), and #NAs.
I would like to turn all ZEROs and #NAs into ""s without repeating this super long formula over and over.
I am curently using:
=IF(or(ISBLANK([superlongformula]),ISNA([superlongformula])),"",[superlongformula])
View 9 Replies
View Related
Aug 2, 2006
How do you write an If then statement using a range of cells? I want to construct a logic test using the range of cells A7:A19. I want the logic test to see if the any of the values =1. If the test is true then I want it to display the value in B7:19 (which ever cell corrulates to the cell in column A that has the value of 1) and display the number in the B column.
View 6 Replies
View Related
Sep 30, 2006
Assume I have a sheet consisting of 50 rows with 3 columns of figures. A fourth column contains a formula to calculate values, eg A1+B1+C1, on each line/row. I could enter A1+B1+C1 in the first cell and Copy, Paste to the other 49 cells. Alternatively, I replace A1+B1+C1 with a UDF.
Is there any difference in performance with using a UDF compared to using the long-hand/standard approach, or is it just a question of convenience? After all, both are doing the same operation with the same calculation.
View 5 Replies
View Related
Aug 8, 2009
I'm reading in a text file with stocks data in the following format:
JRV,Jervois SUM,D,20090807,000000,0.00600,0.00600,0.00500,0.00600,41370,0
JYC,Joyce SUM,D,19900102,000000,1.25410,1.25410,1.25410,1.25410,0,0
etc...
which then compares the three-letter code with a list in the following
format to create a new text file where data is only included if the code
is on the list. Since I added the range search to the code it runs VERY slow
AACAust A Foo
AAFAustral AfMat
AAMA1 MineralMat
AARAnglo AustMat
AAXAusenco LiCap
ABBAbb Grain Foo
ABCAdelaide BMat
etc...
View 9 Replies
View Related
Feb 26, 2006
How to speed up Autofiltering? Excel 2003 sp2 hangs up for 10 minutes after
I choose a record in the Autofilter.
View 13 Replies
View Related
Dec 11, 2006
I'm working on a financial reporting project that should be in Access but unfortunately it must be in Excel. Some of the formula are complex and I have a UDF to calculate these values. I added the line
Application.Volatile
to each UDF but when I change the current month in a dropdown box, the UDF's do not recalculate. The dropdown box sets a period number on one of the worksheets - this same value is passed to each UDF. I tried using this code in my dropdown box :
Sub DropDown4_Change()
Application.CalculateFull
End Sub
but the PC just hangs. I have hundreds (more likely thousands) of formula in the spreadsheet and the recalc is recalcing everything whereas I just want it to recalc the UDF's. I even changed all of the sumproduct formulae to array sum if formulae which sped things up - that is until I forced the full recalc on the drop down change event.
So my question is: is it possible to just recalc the UDF's on 3 worksheets when the user selects a different period in a dropdown box?
And a supplementary question : if {sum(if(...))} formula are faster than sumproduct formula, would a (well written) UDF perform faster than a {sum(if(...))} formula?
View 9 Replies
View Related
Mar 4, 2010
I will attach a sample of the data when I figure out how to. The original data takes about 8 or 9 second to delete the lines.
Code: ...
View 9 Replies
View Related
Jan 15, 2007
to speeding up this little routine that deletes rows that have identical values in certain cells in the row above
Sub remo() ...
View 3 Replies
View Related
Apr 27, 2007
I required to do some Monte Carlo analysis for 1000000 simulation. I have managed to find some free code, however, the time it took to run 1000000 >30min. Is that normal? The code that it took the longest to run is following:
For i = 1 To number_of_trials
Application.Calculate
For j = 1 To number_of_formulas
runs(j, i) = sel. Cells(1, 1 + j)
Next j
Next i
Is there any way I can implove this code to make it run faster? I have already tried Application. ScreenUpdating = False
View 5 Replies
View Related
Oct 11, 2013
I have a time (1:08:31) that it took to travel 35km. How can I calculate the average speed of this competitors plus a number of others who recorded faster or slower time?
I managed to convert the time to seconds but when I load a simple formula to convert to KPH it never works.
View 2 Replies
View Related
Nov 4, 2008
The macro clears specific columns in a row when you click anywhere on the row and then hit the command button. It clears the first range and 2nd range in 2 distinct steps, and takes up to 3 seconds.
View 5 Replies
View Related
Feb 17, 2013
I have 3 numbers:
1) Current Speed
2) Current Acceleration
3) Acceleration Growth
Assuming:
Current Speed=0
Current Acceleration = 0.2 (each 'turn' the current speed will increase by this much)
Acceleration Growth = 0.2 (each 'turn', the current acceleration will grow by this much)
This gives a current speed over a series of 'turns' as
0.0 + 0.2 = 0.2
0.2 + 0.4 = 0.6
0.6 + 0.8 = 1.4
1.4 + 1.0 = 2.4
2.4 + 1.2 = 3.6
3.6 + 1.4 = 5.0
5.0 + 1.6 = 6.6
6.6 + 1.8 = 8.4
8.4 + 2.0 = 10.4
etc.
What I'd like to do is have a formula (or some way other than calculating each step) to tell me how many turns it would take for the Current Speed to =>X (example 100)
Basically, Turns to X speed = something clever * acceleration growth * something else very clever.
View 9 Replies
View Related
Aug 19, 2013
how to speed up a shared excel worksheet?
View 4 Replies
View Related
Mar 21, 2007
A1 has some characters
this code will generate all possible words, that can be made using all characters
system
permutate and checkspelling: if OK then write to column B
example
A1: iftrs
results: first frits rifts
Option Explicit
Dim CurrentRow
Const col = 2
Sub correctly_spelled_permutations()
Dim InString As String
Dim CalcSet As Integer
InString = Range("A1")
If Len(InString) < 2 Then Exit Sub
With Application
.ScreenUpdating = False
CalcSet = .Calculation
.Calculation = xlCalculationManual
.EnableCancelKey = xlErrorHandler
.StatusBar = "searching valid combination"....................
View 9 Replies
View Related
Apr 4, 2007
I use the Application.ScreenUpdating = False all the time. Any there any other things like this which speed up macros?
View 9 Replies
View Related
Aug 16, 2007
I have a Frame on a UserForm. The Width of the frame depends on values given in TextBox.Dat1 and TextBox.Dat2.
Now I tried it with a width of 2200 with a scroll bar, but when I change the value in the Textboxes I need the Frame to be cleared. Now this is my question. I use "UserForm1.Frame1.Clear" but this can take up to 1 minute.
Is there anyway to speed this up?
View 9 Replies
View Related
Oct 15, 2007
I'm trying to automate a process where I get a list of checks and money orders purchased then manipulate it to make auditors happy. I need to eliminate all transactions less than $3000. The fly in the ointment, however, is NOT to eliminate daily transactions by the same purchaser that may be less than $3000, but when added together are greater than $3000.
I've created a helper column where I've inserted the formula ....
View 10 Replies
View Related
Dec 2, 2007
i hv a excel file which have 200k row. recently i learn from this forum using VBA (excel macro code) for select some data for analysis. it take very long. any suggestion will be apprecaited.
i already increase my note book ram to 2GB. it still slow.
View 9 Replies
View Related
Apr 18, 2008
weekly i have a report that is generated that is over 5000 lines and 4 columns wide.
I currently copy and paste one page column to make it 16 columns across the page. Is there a function in excel to do this?
View 9 Replies
View Related
Sep 24, 2008
I am having a big problem with recalculating cells after running a macro. The macro runs at a great speed, but once the calculation is switched back to automatic, the cells are not calculating fast enough. I waited for 4 minutes and it still had not moved past 0%. The worksheet has approximately 9000 rows out to IG columns. 85% of the cells contain an if-then formula.
View 9 Replies
View Related