Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Feb 17, 11:42*am, exceluserforeman
wrote: Hello, Please note that I am not an expert. --------------------------------------------------------------- *Sub btnSubmit_Click() *asutest False: aeetest False * * I do not know what this does? *kaReport.ColholFmtest *End Sub I do not understand this routine. -------------------------------------------------------- *Application.ScreenUpdating = False only applies before the code. You cannot have it in a routine by itself. it will not do anything. It will set itself to true at End Sub -------------------------------------------------------- If you dimension a variable then use it - Dim i *as integer * i = freports.LB_KADates.ListIndex * If freports.LB_KADates.ListIndex = 0 Then if i=0 *Make sure you Dim it at the start of the routine Real Experts Dimension everything. -------------------------------------------------------- "On error goto" *is poor coding. It does not always work as expected. You should "Handle" all expected errors. The same goes for "On Error Resume Next". If you use On Error goto 0 then you have to reference the line. Goto 0 means goto Line: 0, Excel 2003 hates unreferenced references. *Use a word instead of a number. On Error Goto Fred code here Fred: End Sub Error Handling takes up nearly 75% of the entire coding. -------------------------------------------------------- *If MsgBox("Do you want to print the second page containing additional *information?", vbQuestion + vbYesNo, "Colleague Holiday Form") = vbYes Dim Ans ans="Do you want to print the second page containing additional *information?" msgbox(ans, vbQuestion + vbYesNo, "Colleague Holiday Form") if ans=vbyes then else end if --------------------------------------------- Public Sub aeetest(pEnabled As Boolean) Application.enableEvents = False End Sub I am not sure if this will do anything by itself. -------------------------------------------------------- * strBadge = ThisWorkbook.Worksheets("Data1").Range *("A3").offset(rI1, 0).Text *Worksheets("Details1").Range("badge_number").valu e *= strBadge Instead of ".value", maybe ".text" strBadge is a string ie text. Dim intnum as integer intNum=freports.LB_Colleagues.ListCount - 1 This is as far as I've got but I am sure others will contribute with far more extensive help. Personally I do not Dim a listbox. See here for Sample Utilities.http://au.geocities.com/excelmarkswa.../excelmarksway Thanx for your inputs. I will incorporate the following changes and also code the calculation to manual inside each code and then see to it whether it increases the performance. I know for sure one thing that if calculation is set to manual speed increases but i need to figure out where to set it to manual. I have one question for you. If I set the calculation to manual at each function and then in the end again reset it back to automatic will it hamper the functionality. Is there any rules where and which part of code we should set the calculation to manual. I also understand that I need to set the calculation to manual in the code itself and then in the end i need to set it back to automatic. If I do it in the start of the function and set it back to automatic in the end of function will it not work . Eg: Sub A() b() c() d() End sub if i set it just in the starting of A() and at the end of A() set it back to automatic will it not work or I need to go and do it in each and every function. Regards, Prince |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Running Excel 2000 VBA Application on Excel 2003 | Excel Programming | |||
Running Excel 2000 VBA Application on Excel 2003 | Excel Worksheet Functions | |||
Excel 2000 VBA Application on Excel 2003 | Excel Programming | |||
Using Excel 2000 VBA Application on Excel 2003 | Excel Worksheet Functions | |||
Why with Excel Xp takes time to open and in 2003 fast? | Excel Discussion (Misc queries) |