VBA UserForm Code Causes Intermittent Freezing
Feb 6, 2009
I have a multipage userform with about 7 pages. When page 5 is activated, it caused excel to completely lock up. This does not happen everytime but randomly, and I can't seem to figure out what is causing this.
Here is the code -
If Me.MultiPage1.Value = 5 Then
Call LaborCosts
End If
Sub LaborCosts()
If Not Range("A46").Text = "" Then
frmpricingtemplate.Label29.Visible = True
frmpricingtemplate.TextBox46.Visible = True
frmpricingtemplate.Label29.Caption = Range("A46").Text
Else
View 9 Replies
ADVERTISEMENT
Aug 12, 2008
I have a set of userforms, two of which are big with 4 pages and many buttons, labels and textboxes that run or are involved in code being run from user input to the userform.
For some reason certain codes are cauing excel to fully crash, executing these codes will make excel crash each time and the only way to prevent it (that I have found) is to open the userform in VB editor and then close VB editor again, the code will then work perfectly for a while and then it will start crashing again (it is normally a few saves and open/closes later that this occurs).
Logically thinking, opening the userform in VB must reset something that gets corrupted or set incorrectly....
View 7 Replies
View Related
Feb 26, 2007
I have created an AddIn for a project I'm working on using the 'Open' command in Excel Vb. While this worked perfectly for the file I was testing it on (1,740,754 bytes) it doesn't work on a new file (121,445,125 bytes).
On testing the code, one line at a time, it gets stuck on
Line Input #1, DataLine
The files only contain one line so I suspect there is too much data for the command to handle.
Is there an alternative?
View 9 Replies
View Related
Feb 3, 2014
I am creating a report which lists gifts during a two week time period. Most donors have only one gift, listed in column C and D. Some donors have donated twice or three timies in the two week period. I would like these entries, which are intermittent in Cloumns H-I and K-L, to be automatically moved under the corresponding cells in columns C and D. This way an individuals two or three donations all end up in one column.
View 4 Replies
View Related
Feb 6, 2009
I have written a fairly large spread sheet, and I have consistently had excel crashes when the first form initialises at startup.
However if I resave the workbook over itself or sometimes as another name it will then work. Once it works - it will always work while I dont restart my computer. The next day the same workbook will crash on form startup. Once this happens t always crashes on startup. If it works OK first up it always works. However if I edit it the process may happen all over again. I am 100% their is no error in the code as in certain stages it has worked for months. It seams like some bug in excel?
Has anyone ever had this issue?
View 9 Replies
View Related
Jul 8, 2007
I am analysing market data to determine when trades should take place and when they should be closed. This works well. But I need to find the intermittent high value between the dates for purchase and the closing trades, and then insert these values in column S in the attached worksheet.
I don't know if a function can find these values or if a macro is needed (or if I should amend the existing macro that currently finds the
closing trades).
This macro is included in the attached spreadsheet. It Is:
....
View 9 Replies
View Related
Jun 13, 2014
K
L
M
N
L
L
-2.33
View 6 Replies
View Related
May 3, 2007
I searched the forum for an answer to my problem since I'm positive its a FAQ. Well I was right and many other users have asked a similiar question. My problem is this: I am looking to find the average of a set of numbers in column T that meets certain criteria. I was suggested by other user to use this function which finds me the total number. =SUMPRODUCT(--($E$1:$E$400="S"),--($H$1:$H$400=17),--($U$1:$U$400<>"BEBLT"),--($U$1:$U$400<>"NVLIV"),--($T$1:$T400 > 0),$T$1:$T$400)
I have tried inputing Count, Countif, Average in place of Sumproduct as well as Count enclosing the entire sumproduct function. Nothing seems to work for me. I have also tried using a SQL statement in my VBA to provide a count but it doesn't seem to produce the required result. The above function works like a charm for finding the sum, but I need to find the average of this number thus I am looking for the Count equivilant. I'm sure this is a simple problem and I'm still a rookie when it comes to functions in excel.
View 5 Replies
View Related
Apr 9, 2008
I have having alot of frustation with a big group of Macro's I have written,
all the macros work and run fine most of the time but they crash Excel on occasion and the only way I have been able to fix it is to go into Visual Basic and opening the project up (it is password protected) but not making any changes, after doing this it seems to magically stop crashing, for a while, then doing it again.
I can't work out how or why that would make a difference,
I dont expect you to try and work out a problem in the code or anything like that cause it is too big and would be unreasonable of me to ask,
What I would like to know is if anyone else is aware of this sort of issue, why it happens and if there is any good cure for it?
I am running excel 2003 if that also makes any difference.
View 5 Replies
View Related
Apr 10, 2008
I've created a price sheet that I distribute to customers that is very customer specific. I have to add spacing, logo's, borders and highlighting depending on the products being listed. Because of all of this specialization I'm controlling the page breaks and overflow. I have a counter to keep the current line number of the report and another to determine the row within the current page. I've designed my form to have 77 lines per page and I call a pagebreak/overflow routine when I hit line 72 of each page. Works perfectly when I test on my PC and works about 80% of the time when I send to customers, but I have about 20% who have problems with page size and overflow. In working with them I've found that it's not just the printed copy, but also when they print preview on screen. The first few lines of the second page print at the bottom of the first, so the top of page two is cut off. Then 4 lines from page three print at the bottom of two and so on...
View 3 Replies
View Related
Jul 3, 2004
When I run the userform initialize procedure to reset the values in text boxes and the like instead of resetting like it should, now it closes the userform completely and then won't allow me to show it again, what could be the problem?
Private Sub UserForm_Initialize()
Me.MultiPage1.Value = 0
TextBox3.Value = ActiveWorkbook. Sheets("Sales Invoice"). Range("G15").Value
Dim hWndForm As Long
Dim hMenu As Long
hWndForm = FindWindow("ThunderDFrame", Me.Caption) 'XL2000
hMenu = GetSystemMenu(hWndForm, 0)
DeleteMenu hMenu, SC_CLOSE, 0&
End Sub
The Dim stuff down is to gray out the x button, there are also some module level declarations to go with that...
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const SC_CLOSE As Long = &HF060
the userform shows when the workbook opens and is then hidden when the user has finished entering values, then when the user goes through the process of being asked to print and save, they are then asked if they would like to create a new record, if yes then it shows the userform again, but the userform is still filled with all the stuff previously entered. I tried using the unload me instead of hiding and that wouldn't work at all, didn't give errors just didn't show the userform either, this at least shows the userform, but now when the user goes to clear the information by initializing the userform again, it simply closes the userform and then it can't be shown again either.
[url]
This is the link to the ZIP, and here are some instructions for setting it up to work.
The contents of this need to be unzipped into a folder called SyntheticShield that is placed in the C: drive that way all paths begin with C:SyntheticShield and then the other folders or files will be referenced correctly. The template I'm having problems with is the SyntheticShieldInvoiceMaker template, when you open it you'll be prompted whether you want to create a new invoice, number is final blah blah blah, say yes, then it will ask if you are importing from the Quotemaker which you aren't say no, it should then show the userform as it should. Then you can go through that process and by pressing either the create invoice or go to template directly whatever, you can hide the userform. Then you press the command button (red) a userform is brought up asking if you'd like to save without emailing, save with emailing or close controls, as for right now, I'm just getting the save without emailing to work the rest is all the same just a few tidbits of code. So click save without emailing, it should then prompt an are you sure message box, click yes it will do some things, then it will ask if you want to print, click no, then it will ask do you want to create a new invoice, click yes, this should then start the process all over again by calling the workbook_open procedure, however, when you go through everything, and click no to the import from quotemaker part it won't show the userform. And at one point it would, but then I couldn't initialize the userform without it disappearing and not being allowed to be shown...I tried putting a command button on the template to show the userform, but it wouldn't do it either.
View 6 Replies
View Related
Mar 16, 2009
I am charting the following data (for a lot of countries, and the data changes based on a pull down menu which selects the country).
Yr1Yr2Yr3Yr4Yr5
Country1167155175188155
Country2145n.a.150140166
Country3142154n.a.170160
What I don't want is the line on the chart plummeting to zero when there is a "-", i.e. no value.
If I chart this instead:
Yr1Yr2Yr3Yr4Yr5
Country1167155175188155
Country2145[.....]150140166
Country3142154[.....]170160
..., where [.....] means a blank cell, then the 145 does now show up at all.
View 5 Replies
View Related
Nov 10, 2013
I've got a spreadsheet that lists employee hours worked by week, I'm trying to create a function that would give an automatic look-back of both 90 days and 6 months. I've found some useful answers in other threads, but they tend to hinge on a zero value cell signaling the latest week (not) worked; however, for this purpose, some employees may have zero value fields for some weeks but have worked others.
I'm looking for a formula that can be uniformly applied to all employees in the spreadsheet and average their weekly hours for the past 90 or 180 days without having to update the formula each week new hours are entered.
View 3 Replies
View Related
Jan 4, 2010
Intermittent run-time error '75'
Could not find the specified object.
Debug shows VBA Code that simply loads a form called controls
Sub loadcontrols()
Load Controls
Controls.Show
End Sub
Generally works upon restart. Can load and unload the form numerous times. Seems loading the form after a few minutes results in the form failing to load generating the error. Found no consistent cause thus far.
Results in a hard crash: Restart Excel as only option.
The Form Code for Controls loads a modeless transaprent form. Has been working for months. Don't know if this error is new or has been there all along.
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Const GWL_STYLE As Long = (-16)
Private wHandle As Long 'For moving the form
Private m_objCFormSkin As CFormSkin 'For transparancy
View 9 Replies
View Related
Dec 31, 2008
I recently added some command buttons to 6 excel files each with about 20 sheets. most of the sheets got 6 new buttons. After I added the buttons I would get memory errors when I treied to open other files. So I upgraded to Office 2003 and Excel 2003 because I read that it had increased memory available. It did not seem to help much, and now on average about evry say 10 minutes Excel hangs for about 1o seconds, sometimes saying "Not Responding" up the top. Then it starts working again. MY PC has Server 2003 and 1GHz and 512MB of Ram. Here is some info:
=INFO("memavail")1048576
=INFO("memused")50769256
=INFO("totmem") 51817832
=INFO("numfile") 173
=INFO("osversion")Windows (32-bit) NT 5.02
=INFO("release") 11.0
I do not think the PC memory or chip is being stressed it seems to be Excel's memory?
View 4 Replies
View Related
Sep 1, 2009
how do you freeze the top row (header row) so that it stays at the top of the worksheet as you scroll down?
View 3 Replies
View Related
Oct 30, 2009
If I had =A1 in B1, could I "freeze" B1 such that its value updates ONLY upon workbook open?
View 10 Replies
View Related
Dec 18, 2013
I am looking to freeze row 18 in an excel sheet, however in doing so this really limits the amount of rows below row 18 that can be viewed and scrolled through.
I would like to know if there is any way that you could freeze row 18 and when you scroll down on the worksheet, you can scroll down past rows 1-17 and when row 18 reaches the top row it would lock there? And you would then be able to continue scrolling down the worksheet beyond row 18..
View 1 Replies
View Related
Feb 12, 2007
I am having problems with the VBA Editor freezing at the most inconvenient of times when writing code and then clicking to the Sheet I'm working on, it just freezes up the whole of Excel and it has to be shut down and opened up again.
It seems like a memory problem at first, but there is sufficient memory
( 768Mgs, OS is XP Pro, Excel 2000, 9.02).
The work is not lost becuase I'm able to Save even at PC Re-boot, fortunately.
I've tested on 2 different PC's and the same happens. The only way to avoid the freeze it seems, is before I switch to view a worksheet, is to Save then click off VBA Editor and re-open.
When doing so, another symptom is it seems a huge amount of memory is freed up, ( pardon the terminology)
There is also a message that pops up when re-opening that same workbook that there are Formulas Linked to another workbook, but unable to find any after tediously searching every worksheet by using "Find, Look in Formula" there is nothing found, yet.
This freezing may happen twice a minute whilst pointing the mouse cursor from any VBA Edit window or worksheet and it's getting to a point of repetitiously having to Save, click off VBA Editor, and Click back on again each time I need to look at a respective Worksheet.
View 8 Replies
View Related
Feb 13, 2009
I would like to have the column titles stay so I have frozen row 1. But I would also like to freeze row 200 so I can keep up with the running totals at the bottom of the form as I fill in information. Is it possible to freeze a pain at the top and the bottom?
View 4 Replies
View Related
Jun 16, 2009
I need is for a block of cells (A1:I4) to be visible at all times. I've frozen the sheet so that the top four rows are always visible, but unfortunately the sheet is quite large, horizontally-speaking, so that when users scroll horizontally, important stuff scrolls off the screen.
View 9 Replies
View Related
Nov 6, 2009
I have a table that is frozen in b5 meaning that the first column ("A") and rows 1-4 are frozen. The table is large with ever expanding rows. What I want to do is, a good few rows down (say row 300), freeze the row at the bottom of my view and use that row as a mean average row. Therefore allowing me to enter much more data above, but constantly be able to see the averages of the data I am adding.
View 3 Replies
View Related
Mar 12, 2014
How can I lock the contents of an array so that they won't disappear when using auto-filter. "Freeze Panel" doesn't seem to do the job properly.
View 9 Replies
View Related
Jul 2, 2012
Can we freeze particular cell and sheet means no editing is possible for those particular cell or sheet.
View 1 Replies
View Related
Mar 13, 2008
I am using Row 3 as a my template to insert a row for every new line of data i enter. I have a macro that copies the format and formula on this template row to insert at the end every time. The problem is on ROW 3 Cell F i am using a Today() function and everytime i insert a row the date is populated. But the next day the date automatically update.
In my search on this forum, i found this macro to supposedly lock in the dates, but i doesn't work.
VBA:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Range("F2:F10000"), Target) Is Nothing Then
storage = Target.Value
Target.Value = Format(storage, "dd/mm/yy")
End If
Application.EnableEvents = True
End Sub
View 9 Replies
View Related
Apr 27, 2006
How can I freeze a sheet's tab location so it doesn't roll off of the screen? I have a workbook with 30 worksheets all hyperlinked off of the 1st sheet which is the INDEX sheet. The INDEX sheet only exists to make it easier for users to go directly to their desired sheet without tabbing horizontally through many sheet names. However when users use the bottom left arrow buttons to tab through the worksheets, the leftmost INDEX worksheet tab scrolls off of their screen. I realize that they can right click on the left/right tabbing arrows to see a list of all worksheet names, but it would be nice if the INDEX worksheet tab never rolled off of the horizontal tab scroll bar.
View 2 Replies
View Related
May 10, 2006
I have a progress bar on a form......it is there for no reason other than for me to practise such things...the code came off these forums and the bar is powered by a random number...
now my problem is the moment it start running i cannot do anything on the form....i would like my bar to do it's thing but still be able to click on the cancel button to get out of the form any help on this would be fantastic
Private Sub UserForm_Activate()
Dim dTime As Date
Dim i As Integer
Do Until i = 100
For i = 1 To 100 Step 100 / 8
dTime = Now + TimeValue("0:00:01")
Application.Wait TimeValue(dTime) '
ProgressBar1.Value = RandNumGen(1, 98, 1)
'AboutScreen.Repaint
Next i
'AboutScreen.Repaint
Loop
End Sub
View 5 Replies
View Related
Mar 28, 2007
Here is my code. When it pastes it takes so long my comp freezes up. How do i fix? ....
View 9 Replies
View Related
Apr 15, 2009
I'm using Excel 2003 and was wondering if there was a way I could Lock/Freeze the contents of a column. For Example:
Cell A1 has the formula =B1+C1+E1 - figure shown is £405
Cell A2 has the formula =C2+D2+E2 - figure shown is £650
Is there anyway I can freeze column A so when I delete column B,C,D,E ect the correct figure will still show?
View 4 Replies
View Related
Aug 11, 2009
I have a worksheet (Data Lookup) that initially I just required row 1 to be frozen. Now my worksheet would be much easier to read if I was able to freeze row 115 and row 263 when they reached the top of the sheet respectively.
e.g. Row 1 frozen, when I scroll down the sheet and row 115 hits row 1 that would also be frozen and the same with row 263 when it comes into contact with row 115.
I have looked around and cant find a solution and to be honest I'm not sure if it is even possible.
View 7 Replies
View Related