Increase Speed And Simplify VBA

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


ADVERTISEMENT

Increase Speed

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

Increase Speed Of Macro: Match In Font Color It Will Fill The Top With Orange And Delete The Bottom

Dec 12, 2006

My macro works fine but I'm interested in seeing if I can speed it up. What I'm doing is starting at the bottom and comparing it with the row above and if they match in font color it will fill the top with orange and delete the bottom. This works but usually takes several minutes.

Public Sub ADMINCompareList()
Dim varTest1, varTest2
Dim lng As Long, i As Integer, iTest As Integer
Application. ScreenUpdating = False
Worksheets("ADMIN").Activate
For lng = ActiveSheet.UsedRange.Rows.Count To 2 Step -1
If Not Range("M" & lng).Font.Color <> Range("M" & lng - 1).Font.Color Then
Goto newrow
End If
varTest1 = Intersect(Range("J:W"), Rows(lng))
varTest2 = Intersect(Range("J:W"), Rows(lng - 1))
For i = 1 To 14....................................

View 3 Replies View Related

Simplify An IF Function

Jul 31, 2009

is there any way of simplifying the 'IF' function in the 'Grade' column of the attached doc?

View 2 Replies View Related

Simplify Multiple If Else Statements

Aug 24, 2007

I'm using one spreadsheet "Take Off", to pull data from a cell which dictates an objects shape, based on this shape I have a very large IF statement that pulls data from an adjacent cell where an objects dimensions are entered, the statement than proceeds to use these dimensions to calculate the weight of the object.

I've run into the problem with only 7 IF statements, I have gone online and tried to figure out how to avoid this since it is a common problem, but I can't figure out how to do it, most of the examples show very simple and basic formulas. I am unable to figure out how to translate this into my IF statement where I make reference to many cells as well as us differant formulas within the IF statement.

My latest solution was to breakdown the IF statements and try to my my own functions but I think I am too green to have done this properly. Any guidance would be greatly appreciated.

The following is the code I'm working with followed by how I tried to remedy the situation:

=If(Or(C21="BPLT",C21="L"),(((Get_Word(D21,"First")+Get_Word(D21,3))/1000)*(Get_Word(D21,"Last")/1000)*(E21/1000)*7850),If(And(C21="PL",L21<4),(Get_Word(D21,"First")/1000*Get_Word(D21,"Last")/1000*E21/1000*7850), If(Or(C21="BP",C21="PL",C21="BAR"),(Get_Word(D21,"First")/1000)*(Get_Word(D21,3)/1000)*(Get_Word(D21,"Last")/1000)*7850, If(And(C21="HSS",L21>4),(Get_Word(D21,"First

I tried to make my own functions:

aCalc: =If(Or( 'Take-Off'!C13="BPLT",'Take-Off'!C13="L"),(((Get_Word('Take-Off'!D13,"First")+Get_Word('Take-Off'!D13,3))/1000)*(Get_Word('Take-Off'!D13,"Last")/1000)*('Take-Off'!E13/1000)*7850),"")

bCalc:

=If(And( 'Take-Off'!C13="HSS",'Take-Off'!L13>4),(Get_Word('Take-Off'!D13,"First")*2+Get_Word('Take-Off'!D13,3)*2)/1000*Get_Word('Take-Off'!D13,"Last")/1000*'Take-Off'!E13/1000*7850,"")

and so on until hCalc, but when I put them together in a cell like this:
=aCalc()+bCalc()+cCalc()+dCalc()+eCalc()....
I get an error #REF.

I realize a problem might be that I'm referencing a specific cell within my formulas, and many examples online show cells referenced in the form =A$1$, is there a differant way for referencing a cell, because currently I rely on Excel to automatically do this by way of relative reference.

ADDED: Ok I scrapped making the functions because I'm not sure and I did some research on VBA so I tried this one:

Function Weight(Shape As String, Amount As Double, Dimension As String, Optional Length As Variant)
If (Shape = "BPLT" Or Shape = "L") Then
If (Amount > 5) Then
Weight = Get_Word(Dimension, "First") / 1000 + Get_Word(Dimension, 3) / 1000 + Get_Word(Dimension, 5) / 1000 * Get_Word(Dimension, "Last") * 7850
Else
Weight = Get_Word(Dimension, "First") / 1000 + Get_Word(Dimension, 3) / 1000 * Get_Word(Dimension, "Last") * 7850
End If

But when I try to put Weight(C6,D6,F6,E6) I run into the error "Sub or Function Not Defined"

View 7 Replies View Related

IF Function Formula Logic: For Every Increase Of Of Mhz, Give 25.00 Per 100 Increase

Nov 2, 2006

I have a test due in the morning, and I really need this question answered ASAP, if anyone could. I need to create an IF formula for this situation: the standard Mhz is 500. Give 55.00 for that standard. But for every increase of of Mhz, give 25.00 per 100 increase.

View 2 Replies View Related

How To Narrow Down Or Simplify Phone Numbers

Aug 25, 2013

I'm trying to simplified these numbers so each one only consists 8 numbers from the right w/out the blank space or +,-.

Tracking Number
Recip Phone

495905380312
(65)96502898

304612528629
6598941713

495905380746
+6596813956

486044711528
+65 9459 5540

409709299705
6750 2518

409720592221
65-6381-3351

427249160171
6581233832

View 3 Replies View Related

Simplify Calculations With Multiple Variables

May 29, 2014

How to streamline calculations that include multiple variables.

I am trying to calculate results against weighted objectives for multiple associates. Here is a very trimmed down version of the table I have currently:

Associate
Role
Function 1 Count
Function 1 Time
Function 1 Learning Curve
Function 2 Count
Function 2 Time
Function 2 Learning Curve
Function 3 Count
Function 3 Time
Function 3 Learning Curve

[Code] .....

There is an acceptable range (floor & ceiling) of performance for each Role/Function/LearningCurve. In the example above, let's say those ranges are as follows:

Rookie/Function1/A = 1-2
Rookie/Function2/C = 4-6
Rookie/Function3/X = 10-15

I currently run a calculation for that associate determining what % of total time was spent on each function. I multiply that by the floor & ceiling of each range, summing the floors & ceilings to produce a weighted range. Then, I compare their production total to that range. I have all this figured out. What I'm running into, though, is that this table is duplicated on a separate worksheet for each month of the year. Beyond that, each member of management maintains their unique workbook listing this information for their associates only. What I would like to do is publish/maintain only one "master" workbook for all associates, regardless of manager.

I tried creating a master table that inserted columns for Month & Manager in front of the columns above. I tried to use a PivotTable (brand new to that process), but I think that because I have certain variables (i.e., Role & LearningCurve) that are "stuck in the midst" of my data, I can't make heads or tails of the PT.

Currently, I have 3 columns per function (Count, Time & LC) as only one LC would exist in a given month for a given function. I figure I can set up the master sheet to have 8 columns per function (account for Count & Time per each of the 4 LC's possible), but that begins to become more cumbersome than what I have already.

In the end, I want to have a table that I can filter by month and/or manager and/or associate to which I can then apply the appropriate calculations. This would allow calculation for a single month or range of months as well as being able to calculate results for an associate regardless of potential reassignment to a different manager, and conversely being able to aggregate results for a given manager using data for whichever associates reported to them each month.

View 1 Replies View Related

How To Simplify Sequential Logarithmic Decay Formula

Sep 29, 2008

I am trying to create a s/sheet whereby one can calculate how the concentration of an isotope changes (via an exponential decay) with respect to 2 variables:

1. its half-life (arbitrarily shown as 3 'units' in cell E2), and
2. its initial concentration or dose (arbitrarily shown as 100 units) AND subsequent additional exposures (arbitrarily shown as exposure to 50 units every 3 days) (shown in column E).

Thus for example, with an initial dose of 100 units (cell E6), after 3 days, the substance would have decayed by one half-life to 50 units. However, because there was an ADDITIONAL exposure of 50 concentration units on day 3, the EFFECTIVE dose on day 3 = 100 units.

View 2 Replies View Related

How To Speed Up Code

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

How To Speed Up Autofiltering

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

UDF Recalculation And Speed

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

How Can I Speed Up My Loop

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

Speed Up Loop

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

Average Speed Of Competitors

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

Speed Up Clearcontents Macro

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

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

Trying To Calculate (Time To Top Speed)

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

Speed Up Shared Workbook?

Aug 19, 2013

how to speed up a shared excel worksheet?

View 4 Replies View Related

Permutations Checkspelling Speed

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

Speed Up Slow Macros?

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

Speed Up Frame1.Clear

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

How To Speed Up Select Case

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

Shortening A Speed Sheet

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

Calculation/ Macro Speed

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

How To Convert/speed Up This Formula

Oct 31, 2008

The formula: ={IF(AND(ISNUMBER($A3);($A3-DAY($A3)+1)=F$2);$D3;IF(AND(F$2 > ($B3-DAY($B3));F$2 < DATE(YEAR($C3);MONTH($C3)+1;0));$D3/DATEDIF($B3-DAY($B3);DATE(YEAR($C3);MONTH($C3)+1;1);"m");0))}

I need to use this formula for over more than 30.000 rows and more than 50 columns. Is it possible to speed up the formula? Or maybe to handle this by a macro?

View 9 Replies View Related

Speed Up Row Deletion Array

Nov 20, 2008

I currently have a macro set up to delete rows if a certain user selected value is not found in a certain column. It works fine if the sheet isn't overly large but the problem is we have some spreadsheets with 25,000+ rows and it takes time to loop through - I'm not sure if there is even a way to make it faster.

Currently it works by looping backwards on the sheet checking each value in the cell versus an array containing the user selected values. If a match isnt found it deletes this row.

'y = long value representing row
'x = counter for each item in user selected array
'wsSheet = worksheet we are using
'rowLast = last row on spreadsheet
'arrSearch() = string containing user selected items

i have screenupdating/calculations/events turned off - i just didnt know if there was a faster way of looping through

i just thought about instead of doing an array maybe joining the array into 1 string and using a "like" comparison check to see if a match is found - would save me from having to constantly loop x * y amount of times - not sure if this would work or not. ill post back if it doesn't

View 9 Replies View Related

Optimize Calculation Speed

Mar 24, 2009

I have a rather large spreadsheet that takes a very long time to calculate once the new data is added. One of the many things I need to do is look to see if a unique value in range 1 is also in range 2. If it is, return some data (vlookup), if it's not, then I want a "0", not #NA. My question is, which of these two methods will result in a faster calculation (if at all):

Option 1: Do it in one step
=IF(ISNA(VLOOKUP($A3,LY,3,FALSE)),0,VLOOKUP($A3,LY,3,FALSE))

Or option 2: Do it in two steps:
Column N formula:
=VLOOKUP($A3,LY,3,FALSE)

Column N+1 formula:
=IF(ISNA(Column N value),0,=column N value)

I have many columns of data using formulas in option 1, so if I have coded this badly that could be my problem...

View 9 Replies View Related

Speed Up Sheet Calculation

May 1, 2009

I have 40000 rows filling with data from column a to g, autofilter is alway on on said columns , the problem is that when I select any column to filter data as per my query , it takes long time to display result and sometimes it hangs with the msg xyz workbook is not responding.

View 9 Replies View Related

Can I Speed Up The Macro By NOT Saving

Sep 4, 2009

I have this analyze that is runned by a macro in one workbook, and it starts a analyzing-process in another workbook. The data is picked up in the no2 book, and returned to the first book. It is analyzing lots of workbooks, sometimes up to 1000 workbooks, it means that no2 workbook gets a new name and then saved.

I have once heard that the process could be way faster if the workbooks where the analyzes is processed through not were saved, and I actually dont need the books as long as I got the data into my first workbook.

But Im not sure what in the macro that makes it save the no2 workbook, but I would really like to speed up this process. As it is now I have to start the analyze before I go to bed, and the hopefully it's done when I wake up next morning.

View 9 Replies View Related







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