Can u suggest  more efficient way

hi
i have strings like
insert into drmandi_trans (drmt_mandi_code,drmt_commodity_code,drmt_qty_arrived,drmt_morning_price_max,drmt_morning_price_min,drmt_evening_price_max,drmt_evening_price_min,DRMT_Tran_date) values ('MD_INMPBPL003','MD_COM_001', 0,0,0,0,0,#8/3/2001#)
and
update drmandi_trans set drmt_qty_arrived = 012 ,drmt_morning_price_max = 012 , drmt_morning_price_min = 012 ,drmt_evening_price_max = 012 ,drmt_evening_price_min= 012 where drmt_mandi_code = 'MD_INMPBPL003' and drmt_commodity_code = 'MD_COM_002' and drmt_tran_date =#8/3/2001#
i want them to be
insert into drmandi_trans (drmt_mandi_code,drmt_commodity_code,drmt_qty_arrived,drmt_morning_price_max,drmt_morning_price_min,drmt_evening_price_max,drmt_evening_price_min,DRMT_Tran_date) values ('MD_INMPBPL003','MD_COM_001', 0,0,0,0,0,'8/3/2001')
update drmandi_trans set drmt_qty_arrived = 012 ,drmt_morning_price_max = 012 , drmt_morning_price_min = 012 ,drmt_evening_price_max = 012 ,drmt_evening_price_min= 012 where drmt_mandi_code = 'MD_INMPBPL003' and drmt_commodity_code = 'MD_COM_002' and drmt_tran_date ='8/3/2001'
i wrote following method for it and pass these strings to it as parameter
public static String changeForSqlServer(String command)
       StringTokenizer st=new StringTokenizer(command,",=(#)",true);
          StringBuffer sqlServerVersion=new StringBuffer();
          String previousToken="";
          String nextToken="";
          String token="";
          while(st.hasMoreTokens()) 
               token=st.nextToken().trim();
               System.out.println("01 p->"+previousToken+"t->"+token+"n->"+nextToken);                         
               if(token.equals("#"))
                    if(previousToken.equals(",")||previousToken.equals("(")||previousToken.equals("="))
                         System.out.println("1. p->"+ previousToken+"t->"+token+"n->"+nextToken);
                         sqlServerVersion.append("'");
                         previousToken=token;
                         System.out.println("2. p->"+ previousToken+"t->"+token+"n->"+nextToken);
                    else
                         if(st.hasMoreTokens())
                                   nextToken=st.nextToken().trim();
                                   System.out.println("3. p->"+ previousToken+"t->"+token+"n->"+nextToken);
                                   if(nextToken.equals(",")||nextToken.equals(")"))
                                   System.out.println("4 p->"+previousToken+"t->"+token+"n->"+nextToken);                         
                                        sqlServerVersion.append("'").append(nextToken);
                                   System.out.println("5 "+previousToken+"  "+token+"  "+nextToken);                              
                                   else
                                        sqlServerVersion.append(token).append(nextToken);
                                   previousToken=nextToken;
                                   System.out.println(sqlServerVersion);
                         else
                              sqlServerVersion.append("'");
                              return sqlServerVersion.toString();
               else
                    if(!token.equals(""))
                         previousToken=token;
                         sqlServerVersion.append(token);
          return sqlServerVersion.toString();
  }although this method does above task i feel that there may be many improvements possible to make it fastest algorithm.
it will be helpful if u can suggest improvements in this code
or suggest some better algorithms
thanks

Could you simplify what excactly your trying to acheive here? Form the look of it, your doing the job of the JDBC. You should consider reading the JDBC doccumentation or buying a book. You should check for the PreparedStatements wich allow you to set predefined Statements with Variable inputs fields.
Check out :
http://java.sun.com/j2se/1.3/docs/guide/jdbc/index.html

Similar Messages

  • A more efficient way to assure that a string value contains only numbers?

    Hi ,
    I'm using Oracle 9.2.0.6.
    I was curious to know if there was any way I could write a more efficient query to determine if a string value contains only numbers.
    Here's my current query. This SQL is from a sub query in a Join clause.
    select distinct cta.CUSTOMER_TRX_ID, to_number(cta.SALES_ORDER) SALES_ORDER
                from ra_customer_trx_lines_all cta
                where length(cta.SALES_ORDER) = 6
                and cta.SALES_ORDER is not null
                and substr(cta.SALES_ORDER,1,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,2,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,3,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,4,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,5,1) in('1','2','3','4','5','6','7','8','9','0')
                and substr(cta.SALES_ORDER,6,1) in('1','2','3','4','5','6','7','8','9','0')This is a string where I'm finding A-Z-a-z characters and '/' and '-' characters in all 6 positions, plus there are values that are longer than 6 characters. That's what the length(cta.SALES_ORDER) = 6 is for. Also, of course. some cells are NULL.
    So the question is, is there a more efficient way to screen out only the values in this field that are 6 character numbers or is what I have the best I can do?
    Thanks,

    I appreciate all of your very helpfull workarounds. The cost is a little better in all cases than my original where clause.
    To address the discussion that's popped up about design from this question, I can say a few things that should clear , at least, my situation up.
    First of all this custom quoting , purchase order , and sales order entry system WAS written by a bunch a of 'bad' coders who didn't document their work and then left. We don't even have an ER diagram
    The whole project that I'm only a small part of is literally trying to put Humpty Dumpty together again and then move it from a bad custom solution into Oracle Applications.
    We're rebuilding, documenting, and doing ETL. This is one of your prototypical projects from hell.
    It's a huge database project so we're taking small bites as a time. Hopefully, somewhere right before Armageddon hits, this thing will be complete.
    But until then,..., well,..., you know the drill.
    Thanks Again.

  • Can you suggest a best way to store and read arabic from oracle database?

    Hi ,
    can you suggest a best way to store and read arabic from oracle database?
    My oracle database is Oracle Database 10g Release 10.1.0.5.0 - 64bit Production on unix HP-UX ia64.
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CHARACTERSET WE8ISO8859P1
    I have presently stored the data in nvarchar2 field. But i am not able to display it correctly.

    Using the national characterset should work but there are other factors that you have to consider when working with NCHAR/NVARCHAR2/NCLOB.
    If possible, changing the characterset is usually the best solution if it's a possiblity for you.
    For more info:
    Dear Gurus: Can u pls explain the difference between VARCHAR2 & NVARCHAR2??

  • Creating a time channel in the data portal and filling it with data - Is there a more efficient way than this?

    I currently have a requirement to create a time channel in the data portal and subsequently fill it with data. I've shown below how I am currently doing it:
    Time_Ch = ChnAlloc("Time channel", 271214           , 1      ,           , "Time"         ,1                  ,1)              'Allocate time channel
    For intLoop = 1 to 271214
      ChD(intLoop,Time_Ch(0)) = CurrDateTimeReal          'Create time value
    Next
    I understand that the function to create and allocate memory for the time channel is extremely quick. However the time to store data in the channel afterwards is going to be highly dependent on the length I have assigned to the Time_Ch. In my application the length of Time_Ch is variable but could easily be in the order of 271214 or higher. Under such circumstances the time taken to fill Time_Ch is quite considerable. I am wondering whether this is the most appropriate way of doing things or whether there is a more efficient way of creating a time channel and filling it.
    Thanks very much for any help.
    Regards
    Matthew

    Hi Matthew,
    You are correct that there is a more efficient way to do this.  I'm a little confused about your "CurrDateTimeReal" assignment-- is this a constant?  Most people want a Time channel that counts up linearly in seconds or fractions of a second over the duration of the measurement.  But that looks like you would assign the same time value to all the rows of the new Time channel.
    If you want to create a "normal" Time channel that increases at a constant rate, you can use the ChnGenTime() function:
    ReturnValue = ChnGenTime(TimeChannel, GenTimeUnit, GenTimeXBeg, GenTimeXEnd, GenTimeStep, GenTimeMode, GenTimeNo)
    If you really do want a Time channel filled with all the same values, you can use the ChnLinGen() function and simply set the GenXBegin and GenXEnd parameters to be the same value:
    ReturnValue = ChnLinGen(TimeChannel, GenXBegin, GenXEnd, XNo, [GenXUnitPreset])
     In both cases you can use the Time channel you've already created (which as you say executes quickly) and point the output of these functions to that Time channel by using the Group/Channel syntax of the Time channel you created for the first TimeChannel parameter in either of the above functions.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • I have just updated my software on my iPhone 4S to IOS7.0.4 now I have lost many of my contacts.   Can anyone suggest an easy way to reinstate them.  (Without having to add them all again as I don't know what I have lost until I need it).

    I have just updated my software on my iPhone 4S to IOS7.0.4 now I have lost many of my contacts.   Can anyone suggest an easy way to reinstate them.  (Without having to add them all again as I don't know what I have lost until I need it).

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • More efficient way to extract number from string

    Hello guys,
    I am using this Regexp to extract numbers from a string, and I doubt that there is a more efficient way to get this done:
    SELECT  regexp_replace (regexp_replace ( REGEXp_REPLACE ('  !@#$%^&*()_+= '' + 00 SDFKA 324 000 8702 234 |  " ' , '[[:punct:]]',''), '[[:space:]]',''), '[[:alpha:]]','')  FROM dual
    {code}
    Is there a more efficient way to get this done ?
    Regards,
    Fateh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Or, with less writing, using Perl syntax \D (non-digit):
    SELECT  regexp_replace('  !@#$%^&*()_+= '' + 00 SDFKA 324 000 8702 234 |  " ','\D')
      FROM  dual
    REGEXP_REPLACE(
    003240008702234
    SQL>
    {code}
    SY.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • MDX - More efficient way?

    Hi
    I am still learning MDX and have written this code. It needs to recalculate all employees in a cost center (COSTCENTER is a property of the DIM EMPLOYEE) when one of the assumptions (e.g P00205 etc) change. These assumptions are planned on cost center level and planned against employee DUMMY. Is there a more efficient way to write this code as there are lots of accounts that needs to be posted to::
    *SELECT (%EMPLOYEE%, ID, EMPLOYEE, [COSTCENTER]  = %COSTCENTER_SET%)
    //Workmens Comp
    *XDIM_MEMBERSET P_ACCT = "IKR0000642000"
    *FOR %EMP% = %EMPLOYEE%   
             [EMPLOYEE].[#%EMP%] = ( [P_ACCT].[P00205],[EMPLOYEE].[DUMMY ]) * ( [P_ACCT].[P00400],[EMPLOYEE].[%EMP%] )
    *NEXT
    *COMMIT
    //Fringe Benefits Employer
    *XDIM_MEMBERSET P_ACCT = "IKR0000628100" 
    *FOR %EMP% = %EMPLOYEE%
             [EMPLOYEE].[#%EMP%] = ( [P_ACCT].[P00210],[EMPLOYEE].[DUMMY ]) * ( [P_ACCT].[P00400],[EMPLOYEE].[%EMP%] )
    *NEXT
    *COMMIT
    //Fringe Benefits Other
    *XDIM_MEMBERSET P_ACCT = "IKR0000626100" 
    *FOR %EMP% = %EMPLOYEE%
             [EMPLOYEE].[#%EMP%] = ( [P_ACCT].[P00209],[EMPLOYEE].[DUMMY ]) * ( [P_ACCT].[P00400],[EMPLOYEE].[%EMP%] )
    *NEXT
    *COMMIT

    Maybe the following?
    *SELECT (%EMPLOYEE%, ID, EMPLOYEE, [COSTCENTER]  = %COSTCENTER_SET%)
    *XDIM_MEMBERSET EMPLOYEE = %EMPLOYEE%
    *XDIM_MEMBERSET P_ACCT = IKR0000642000,IKR0000628100,IKR0000626100
    //Workmens Comp
    [P_ACCT].[#IKR0000642000] = ( [P_ACCT].[P00205],[EMPLOYEE].[DUMMY] ) * ( [P_ACCT].[P00400] )
    //Fringe Benefits Employer
    [P_ACCT].[#IKR0000628100] = ( [P_ACCT].[P00210],[EMPLOYEE].[DUMMY] ) * ( [P_ACCT].[P00400] )
    //Fringe Benefits Other
    [P_ACCT].[#IKR0000626100] = ( [P_ACCT].[P00209],[EMPLOYEE].[DUMMY] ) * ( [P_ACCT].[P00400] )
    *COMMIT
    You should probably also restrict explicitly on all other dimensions in your applications so that none are accidentally left open that don't need to be.
    Ethan

  • Linking from one PDF to another: Is there a more efficient way?

    Some background first:
    We make a large catalog (400pages) in Indesign and it's updated every year. We are a wholesale distributor and our pricing changes so we also make a price list with price ref # that corresponded with #s printed in the main catalogue.  Last year we also made this catalog interactive so that a pdf of it could be browsed using links and bookmarks. This is not too difficult using Indesign and making any adjustments in the exported PDF. Here is the part that becomes tedious and is especially so this year:
    We also set up links in the main catalog that go to the price list pdf - opening the page with the item's price ref # and prices... Here's my biggest issue - I have not found any way to do this except making links one at a time in Acrobat Pro (and setting various specifications like focus and action and which page (in the price list) to open) Last year this wasn't too bad because we used only one price list. It still took some time to go through and set up 400-500 links individually.
    This year we've simplified our linking a little by putting only one link per page but that is still 400 links. And this year I have 6 different price lists (price tiers...) to link to the main catalogue pdf. (That's in the neighborhood of 1200-1500 double clicking the link(button) to open Button Properties, click Actions tab, click Add..."Go to page view" , set link to other pdf page, click edit, change Open in to "New Window" and set Zoom.  This isn't a big deal if you only have a few Next, Previous, Home kind of buttons....but it's huge when you have hundreds of links. Surely there's a better way?
    Is there anyway in Acrobat or Indesign to more efficiently create and edit hundreds of links from one pdf to another?
    If anything is unclear and my question doesn't make sense please ask. I will do my best to help you answer my questions.
    Thanks

    George, I looked at the article talking about the fdf files and it sounds interesting. I've gathered that I could manipulate the pdf links by making an fdf file and importing that into the PDF, correct?
    Now, I wondered - can I export an fdf from the current pdf and then change what is in there and import it back into the pdf.  I've tried this (Forms>More Form Options>Manage Form Data>Export Data) and then opened the fdf in a text editor but I see nothing related to the documents links... I assume this is because the links are 'form' data to begin with - but is there away to export something with link data like that described in the article link you provided?
    Thanks

  • Which is more efficient way to get result set from database server

    Hi,
    I am working on a project where I require to query database to fetch result set and then iterate through the resultset. Now, What I want is that I want to create one single java code that would call many different SQLs and create a list out of resultset. There are two approaches for me.
    1.) To create a txt file where I can store my queries. My java program can read this file and get the appropriate query to be used.
    2.) To create a stored procedure containing the queries and call the stored procedure from my java program. Also, not that some of the queries needs to be created dynamically depending upon the parameteters supplied.
    Out of these two approches which is optimum and why?
    Also, following things to be noted.
    1. At times I want to create where clause of the query dynamically depenending upon the parameters passed.
    2. I want one single java file that will handle all database calls.
    3. Paramters to the stored procedure can be passed using array descriptor.
    4. Conneciton I am making using JNDI.
    Please do provide me optimum way of out these two. You may also suggest some other approaches, if any.
    Thanks,
    Rajan
    Edited by: RP on Jun 26, 2012 11:11 PM

    RP wrote:
    In case of queries stored in text files. I will require to replace some pre defined placeholder with actual parameters and then pass that modified query to db engine. Even I liked the second approach as it is more easily maintainable. There are a couple of issues. Shared SQL is one. Irrespective of the method used, the SQL cursor that is created needs to have bind variables. This ensures re-usability of the cursor. This reduces the risk of Shared Pool fragmentation. This lowers hard parsing and reduces CPU utilisation.
    Another issue is flexibility. If the SQL cursors are created by stored procedures, this code resides on the server and abstracts the Java client from the complexities of SQL and SQL performance. The code can easily be updated and fine tuned to deliver faster/better SQL cursors, or modified to take new Oracle features, changes in data model, and so on, into consideration. This stored proc can be updated without having to touch or recompile a single byte of Java client code.
    There's also the security issue. What is more secure? SQL encapsulated in stored procs in a secure database and server environment? Or SQL "encapsulated" in text files on the client?
    The less code you have running on the client, the less code you have running in the wild that can be compromised without having to first compromise the server.
    Only I was worried about any performace issue might happen using this approach. Performance is not a factor of who creates the SQL cursor.
    Whether Java client creates a SQL cursor, or a PL/SQL stored proc creates a SQL cursor, or a .Net client creates a SQL cursor - that SQL cursor does not know what the client is. It does not care what the client is. The SQL cursor performs as well as it is capable of.. given the execution plan, data volumes, server resources and speed/performance of the server.
    The client language and SQL cursor interface used by the client (there are several in PL/SQL), determines the performance of the client's interaction with the cursor (e.g. round trips to the database when interfacing with the cursor). The client language (and its client interface to the cursor) does not dictate the actual performance of that SQL cursor on the database (does not make joins faster, or I/O faster)
    One more question, Will my java program close the cursor that I opened in Procedure?That you need to ask your Java code. Java code leaking ref cursors are unfortunately all too common. You need to make sure that your Java client interface to SQL cursors, closes the cursor handle when done.

  • My mac is slow. How can it run more efficiently?

    I find that my 2 year old Macbook Pro is super slow and just started to run slow about 4 months ago. It takes a long time to load and execute programs. Is there anything that I can do at home to allow the computer to run faster?

    First, back up all data immediately, as your boot drive might be failing.
    Take these steps when you notice the problem.
    Step 1
    Launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Activity Monitor in the icon grid.
    Select the CPU tab of the Activity Monitor window.
    Select All Processes from the menu in the toolbar, if not already selected.
    Click the heading of the % CPU column in the process table to sort the entries by CPU usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Also post the values for % User, % System, and % Idle at the bottom of the window.
    Select the System Memory tab. What values are shown in the bottom part of the window for Page outs and Swap used?
    Next, select the Disk Activity tab. Post the approximate values shown for Reads in/sec and Writes out/sec (not Reads in and Writes out.)
    Step 2
    You must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way as above. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left.
    Post the 50 or so most recent messages in the log — the text, please, not a screenshot.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into a message.
    Important: Some personal information, such as your name, may appear in the log. Edit it out before posting.

  • More efficient way to find an element...

    I am iterating through a vector to determine if it contains a specific element, as determined by an id. I know there must be a better way to do it than the example below. I looked into LinkedHashMap a little bit. Could that be a lest costly solution?
    Any examples would be much appreciated...
    String idToFind = 2314;
    for(Enumeration e = reallyBigVector.elements();e.hasMoreElements();) {
          String[] nextPerson = (String[]) e.nextElement();
          if(nextPerson [5].equals(idToFind))//nextPerson [5] is their id
               return true;
    return false;//didn't find it

    btv wrote:
    I am iterating through a vector to determine if it contains a specific element, as determined by an id. I know there must be a better way to do it than the example below. I looked into LinkedHashMap a little bit. Could that be a lest costly solution?
    Any examples would be much appreciated...
    String idToFind = 2314;
    for(Enumeration e = reallyBigVector.elements();e.hasMoreElements();) {
    String[] nextPerson = (String[]) e.nextElement();
    if(nextPerson [5].equals(idToFind))//nextPerson [5] is their id
    return true;
    return false;//didn't find it
    No no no. Don't go storing data in an array of Strings that can be encapsulated in a class. Create a custom Person class holding this data:
    public class Person {
      private int id;
      // other attributes and methods
    }then override equals(Object) and hashCode() in that class so you can look up your object more easily from a collection class.
    More info: [http://java.sun.com/docs/books/tutorial/java/concepts/]

  • More efficient ways to deal with query than using IN clause???

    There is a module in an application that I wrote that under certain circumstances executes a query that looks something like the following:
    SELECT field1, field2
    from table
    where id in (1,2............1000)
    OR id in (1001,1002.............2000)
    OR id in (59000, 59001.................60000);
    To clarify... Yes.. I am saying that because of oracle's limitation on 1000 expressions in an IN clause, there would be up to 60 different IN clauses.
    When I initially wrote this module... I wasn't aware of the volume of data that I was dealing with. I fully expect that when running this module with real data, it is going to be painfully slow. I am also worried about out of memory errors. Does anyone have suggestions? Thanks!
    Btw... This is using ORACLE 10g

    Depending on the number of rows in the table, I would tend to look at loading the ID's into a temporary table and then using that temporary table in your search, i.e.
    SELECT field1, field2
      FROM table
    WHERE id IN (SELECT id FROM new_temp_table)or
    SELECT field1, field2
      FROM table a
    WHERE EXISTS (
        SELECT 1
          FROM new_temp_table b
         WHERE a.id = b.id )Of course, if the logic for figuring out the 60,000 ID's you want to search on can be expressed as a SQL query, you could replace the temp table in the above examples with that particular SQL expression.
    Justin

  • Hi all, I have lost my iPod 2 days back. As it does not have a network connection, I couldnot trace it out using Find my iPhone app. Can you suggest me other ways to trace my iPod?

    Please help me in tracing my iPod Touch which went lost 2days back.

    lost/stolen                                     
    No app on the iOS device is required.                           
    - If you previously turned on FIndMyiPod/iPhone/iPad on the iOS device in Settings>iCloud and wifi is on and connected or cellular data is on and connected for, on a computer browser go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up or continue to show off-line.
    - You can also wipe/erase the iOS device and have the device play a sound via iCloud.
    iCloud: Erase your device
    iCloud: Use Lost Mode
    Done
    - If not shown, then you will have to use the old fashioned way, like if you lost a wallet or purse. Retrace your steps
    - Change the passwords for all accounts used on the device and report to police and carrier if iPhone or cellular iPad
    - There is no way to prevent someone from restoring the erase (it erases it) using it unless you had iOS 7 or later on the device. With iOS 7 or later, one has to enter the Apple ID and password to restore the device.
    - Apple will do nothing without a court order                                               
    Reporting a lost or stolen Apple product                                              
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • Looking to see if this VBA subroutine can be made more efficient

    To All,
      I have put together a SUB that depending on a constant averages those numbers together then starts the process of exponential smoothing of the number until the last row of data.  As it does so, it checks to see if it is at the last row and then
    copies the last number to row 2 of the same column.
      It works fine, but seems a little slow for just 11 columns and 200 rows.  Any thoughts on how to increase the efficiency of the routine?
    Thanks
    Harry
    Private Sub EMACalc()
    'EMA Calculations
    Dim numRows As Integer
    Dim EMAWindow As Long
    Dim colCount As Integer
    Dim rowCount As Integer
    Dim col As Integer
    Application.Calculation = xlCalculationManual
    Application.ScreenUpdating = False
    numRows = Sheets("InvertData").UsedRange.SpecialCells(xlCellTypeLastCell).Row - 1
    colCount = Application.WorksheetFunction.CountIf([BlanksRange], "<>" & "") - 1
    EMAWindow = [EMAConst]
    For col = 1 To colCount
    Sheets("EMALng").Cells(EMAWindow + 1, col) = "=Average(InvertData!R[-" & EMAWindow - 1 & "]C[2]:R[4]C[2])"
    For rowCount = EMAWindow + 2 To numRows
    Sheets("EMALng").Cells(rowCount, col).FormulaR1C1 = "=InvertData!R[4]C[2]*(2/(EMAWindow + 1)) + R[-1]C * (1-(2/(EMAWindow+1)))"
    If rowCount = numRows Then
    Sheets("EMALng").Cells(2, col).Value = Sheets("EMALng").Cells(rowCount, col).Value
    Else
    End If
    Next rowCount
    Next col
    Application.Calculation = xlCalculationAutomatic
    Application.ScreenUpdating = True
    End Sub

    Hi Harry,
    >> It works fine, but seems a little slow for just 11 columns and 200 rows.
    I don’t quite understand the goal you were trying to achieve through the code. Based my understanding, accessing 2000+ cells and changing the formula cell by cell may make the macro running slow.
    Since I’m not very familiar with your business requirement, I’m not sure whether it is possible to put the logic on the formula instead of changing the formula dynamically through VBA.
    Hope it will help.
    Regards,
    Jeffrey
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • A much more efficient way to add C Series modules manually

    Scenario
    Suppose that we want to start coding my Real-Time application, but the hardware hasn't arrived yet.
    We can't Discover the chassis + modules, so we need to add modules manually.
    Current editor
    To add N modules, we need to launch this dialog N times:
    Right-click on Chassis in the Project Explorer
    Hover over "New"
    Click "C Series Modules…"
    Click "New target or device"
    Click "C Series Module"
    Click "OK"
    Wait for LabVIEW to fetch module list (wait ~1 second)
    Select Type (2 clicks)
    Select Location (2 clicks)
    Click "OK"
    Go to #1 to add a new module
    How tedious!
    Proposed Editor
    Wouldn't it be nice if we could set up all the modules in 1 dialog?
    Features
    Table auto-fills itself with modules already in the project
    Number of rows is determined by the chassis model. No need to select Location
    Ability to leave rows/slots empty
    Editable Name field (with default name) appears upon selecting Type
    Description appears upon selecting Type
    Feel the difference
    Adding N modules (using default names) requires...
    Current dialog: 10N clicks, N hovers, waiting N seconds
    Proposed dialog*: (6+2N) clicks, 1 hover, waiting 1 second
    So, adding 8 modules requires...
    Current dialog: 80 clicks, 8 hovers, waiting 8 seconds
    Proposed dialog*: 22 clicks, 1 hover, waiting 1 second
    *Assuming that steps 1-7 and 10 need to be performed once
     

    Oh, and if this is implemented, please make sure that users can comfortably fit all text on their screen!

Maybe you are looking for

  • Help required  regarding ObjectValueSelector

    Hi all, I have a requirement like this, in my View I have 2 DropDownByKeys  and 1 input field. The inputfield should be empty and the 2 DropDoenByKeys shud be populated with the data from backend, when I click on save button, the data shud be saved i

  • I have lost my passcode and cant sync my iphone either

    PlEaSe HeLp I have lost my passcode and cant sync my my phone either so i cant access anything to change it.

  • Dynamic Parameter cannot fetch DB values

    hello experts, i make a report in Crystal Reports w/ 2 parameters 1 static parameter and 1 dynamic parameter. when i preview the report in CR static param and dynamic param are ok. but when i published the report in sbo using Crystal report add-on th

  • Need an Exit  to find ZIP code of Delivery address in PO.

    Hi Experts, I am an abaper & i am tryin to connect Taxwar & SAP during the prcess of PO creation. Now my req is to find if the plant address & the Delivery address are different ( need to compare the ZIP codes). Can anyone sugget an exit where i can

  • Background job for sending Fax

    Hi,   I want to know, if there is any standard program which can be scheduled in the background to send FAX. Currently I am manually resending the FAX using transaction SOST. Cheers, Sugopa