Macro With Large Number Of Loops Crashes. Clear Cache?
Dec 13, 2007
I have a VBA macro that goes through a decently complex system to delete something like 70 old tabs, create new ones, link data from a main page to these tabs, and create 3 plots per tab. When running the script, it will go through something like 50 of the tabs, and then receive an error on something rather trivial that has been done many times before successfully in this macro (like changing the font size on one of the axes on one of the graphs). I tried an On Error Resume Next, and sure enough it ignores the error, but it then does some sort of crazy loop starting over recreating all the tabs incorrectly, and then excel just shuts down. So, that's no good.
Anyway, I can comment out the change of the font size, but it still has the same issue on some other trivial thing. It seems like the system just runs out of room or needs a cache cleared or something. I'm not sure.
View 9 Replies
ADVERTISEMENT
Sep 3, 2008
I keep encountering an error while creating multiple sheets within the same workbook. This is a known error by Microsoft as documented here. In order to avoid using multiple workbooks i need to clear excels cache each time I run the macro as i have limited users sheet creation to 30 sheets which should not trigger the error. Does any one know a code to clear excels cache or memory?
I have used cutcopymode = false but that does not do the trick.
View 9 Replies
View Related
Jun 4, 2008
I am currently taking over a workbook from a colleague that contains 10 pivot tables. Spaced out over a few sheets.
Each pivot table contains a lot of information and my current workaround to refreshing them all is..
Step1:Refresh 2 Pivots,
Step2:Save and Close document,
Step3: Re-Open document and repeat Steps 1 & 2 until all refreshed.
I was wondering if there was any kind of code to clear the memory space being used by the pivots thus leaving the hard coded information behind.
That way I can just write some vb to refresh all the pivots and not keep saving and re-opening the document which takes sometime as its on a network drive.
View 9 Replies
View Related
Aug 8, 2009
I'm writing an application in Excel, its a little over 5MB after I've run through UsedRegion and trimmed stuff, 94 worksheets. I'm encountering a fair number of crashes these days. My OS is fully patched as is MS Office. Running Windows server 2003 and Excel 2007.
I was wondering about the pros and cons of writing an application in one large workbook or many smaller ones. So far its been one large one but these crashes are really impeding my progress.
What's the best way to remedy these crashes or even start to diagnose?
View 7 Replies
View Related
Jul 9, 2012
Recorded macro. The hope is to insert a excel formatted table a set number of times. I have found a loop code that references a Cell A1 and repeats that amount of times. So if A1= 10. There should be 10 tables inserted. However on the second time there is a fault with the table name. I need the name to change each time the loop is run. ie Table1, Table2, Table3 etc up until the loop stops (A1 contents).
I am using excel for windows 2010. The macro that i have so far is below.
Sub LoopTest()
Dim n
Dim V
Range("A1").Select
V = ActiveCell.Value
[Code] ........
View 1 Replies
View Related
Jul 13, 2006
What i'm trying to do is to check a large number of cells, if "0" is written down in that cell it stays as it is and if the number is different from "0" i want to put a "1" instead.
View 5 Replies
View Related
Feb 18, 2008
I would like to write a macro that links cells in one workbook (working) to cells in another workbook (summary).
I don't want this to be a straight swap thought, I'd like it to contain the following formula:
=IF(Working!G8="a","a","")
The cells in the working workbook are listed vertically, while the cells in the summary workbook are listed horizontally.
ie. link G8-G18 in working to B3-K3 in summary
link H8-H18 in working to B4-K4 in summary
...etc
View 9 Replies
View Related
Jun 8, 2010
Is there a way to count the times a loop has occurred and be able to present a running total in the status bar of MS Excel?
Code:
Sub Master_Phone()
'
' Select cell A2, *first line of data*.
[Code].....
View 4 Replies
View Related
Oct 18, 2008
i have this code that upon opening of workboot it generates the next number thats available on sheet 2 i then enter the data that i need to and click the button it then transfers to sheet2 and prints 2 copies and then clears the cells that i have input data to
what i really need it to do is exactly as it does right now but to then change the next number available to what it is ....
View 14 Replies
View Related
Mar 18, 2012
I would like to make a macro that loops another macro and changes a value in a cell, like such:
Run macro
if cell A1 = cell A2
Stop
Else set value in cell A1 -0.1
Loop
How exactly would i do that?
I have a little bit:
Sub Macro2()
Call wantedmacro
With Range("A1")
If .Cells(1, 1).Value = "A2" Then Exit Sub
Else Range("A11").Value = (A1-0.1)
Call Macro2
End Sub
View 4 Replies
View Related
Jan 25, 2010
When I run a group of macros for some reason after the marcro runs and I hit F2 excel crashes.
I have figured out that it is one of the marcros that makes the excel crash. It is only when I run the solver application. The code is below. Any thoughts why hitting F2 after running this marcro would crash the machine?
View 10 Replies
View Related
Feb 15, 2008
I have created a macro in xl2000 which was working fine - although through corporate upgrades my machine has now been upgraded with xl2003 and the macro runs for a bit and then crashes on the code below, although it only highlights teh 'rnum'
rnum = ActiveCell.Row
Is there a difference between xl2000 & xl2003?
View 9 Replies
View Related
May 1, 2012
I am trying to creat a macro that loops all the named ranges in a worksheet named "Labels", and copy the data to a new worksheet for each named range it finds in the same workbook and name each worksheet with the named range name.
View 5 Replies
View Related
Jun 3, 2009
I have a report I produce where I take an XML file, sort it and run some simple formulas then sort another way and run a few more formulas then update a pivot table. The XML files I'm using have the same headers but vary in length. When I set the macro up for a particular XML file everything works fine. When I import another one (different size) I get the error message:
Run-time error ‘1004’:
Sort method of Range class failed
When I look at the code I see that the range is fixed to the XML file I used when setting the macro up. Is there a way to auto-select the table in the macro so I can run the same macro on any size XML?
View 7 Replies
View Related
Dec 19, 2009
I have the following strange problem. A simple macro 'ActiveWorkbook.Close' causes excel to crash if I use it with a button on my sheet (a form). When I run the macro via developer > macros > run
the macro runs as expected. Even if a run the macro with alerts (thanks to jproffer) the problem persist.
View 8 Replies
View Related
Aug 15, 2014
I'm having a problem with a macro clearing a formula in a cell. I have the same type of cell that doesn't have the problem but I can't find the difference between the 2 cells or difference in vb that's making it happen. I have to intentionally cause this to happen but don't see why it's happening. Do I need to attach workbook and describe what's happening? I have been copying and pasting from different sources as well as paying to have it created/started but it was expensive(for me) and I make nothing off of it, just use it at work. I am not proficient in Excel or vb but I'm desperately trying to learn as I go so as not to fork out a few hundred dollars again.
here's atleast the vb for the macros:
VB:
Sub clearclientinfo() '
'
'
'
Sheet5.Select
[Code].....
View 9 Replies
View Related
Mar 20, 2014
I have developed a model for a client which keeps crashing after being used a few times. The crash is major! Excel shuts down and asks to send an error report.
This can happen after being run anywhere from 3 to 20 times. (Clicking a POST button which transfers items to a "database" type sheet).
I developed the model on a PC using Excel 2010. When this was loaded on a Mac, the user tells me that it happened periodically, and I have seen is occasionally on my PC as well.
However, the workbook has now been loaded on a server, with users across the state of Victoria accessing via Sharepoint - most using Excel 2007. Now it is happening very frequently.
I don't think the macro is at fault, it doesn't go into debug. Excel just seems to GIVE UP.
Have you seen this kind of thing before? Is there a way of "flushing buffers" or something so that Excel can keep working?
I am reluctant to post the model because it is full of personnel details, and is 2.5mb.
View 6 Replies
View Related
Jul 26, 2009
I have comment blocked the code that causes Excel to crash.
View 4 Replies
View Related
Dec 20, 2013
The macro does numerous things, including deleting the sheet that was active when it is called. If the sheet is not deleted, there is no crash. Otherwise, Excel crashes as soon as the VBA interpreter hits "Exit Sub". The Excel message is simply "Excel Stopped Working". The macro also saves the workbook before finishing, and the saved workbook opens just fine, but it's unacceptable to have to kill Excel and restart it every time (I am not the main user for this spreadsheet). I'm using Excel 2010 on Windows 7.
View 7 Replies
View Related
Feb 10, 2006
I'm just wondering if any of you can lend some help on a bug i'm encountering. When I press a button on my worksheet to call a macro that brings up a userform, the excel will crash, and give that "do you want to report this error", close down excel, and reopen on a blank worksheet. Strange thing is, this error is avoided if I save the workbook upon opening it, and then call that macro.
The workbook does not read data from external sources, so i dont think is that problem.
Has anyone encountered this?
View 9 Replies
View Related
Feb 28, 2012
I have a VBA macro for Excel 2007 below that loops through a workbook and deletes a picture (shape) in a range at the top of each worksheet.
The macro works fine until a cell which contains a seemingly unrelated data validation list on Sheets(1) is changed. The macro then repeatedly trips up with a 'Run-time error 1004 - Application defined or object defined error'.
The cell with the data validation is outside of the range in which the shapes are deleted and does not set any of the variables in the macro.
Sub DeleteLogos()
Dim Count As Integer
Dim NumberOfWorksheets As Integer
Dim Logo As Shape
Dim LogoZone As Range
NumberOfWorksheets = Worksheets.Count
For Count = 1 To NumberOfWorksheets
With Sheets(Count)
[code].....
View 4 Replies
View Related
Aug 17, 2007
If I have the numbers 1-50 repeating in columns, 1-50, 1-50 etc is there a way to determine that number "1" falls 1st, 51st etc in the sequence without doing a manual count? Or that the number 2 falls 2nd, 52nd etc?
View 10 Replies
View Related
Jan 10, 2007
I am trying to copy part of one line of pasted information in to a certain place on the line below.
i.e I want
ABCabc
to look like
ABC
abc
This needs to happen for a large number of lines. I have already added a space in between all the original lines.
View 9 Replies
View Related
Sep 22, 2009
I'm working on a spread sheet to identify the to ten numbers from a list. I can find thes numbers and use ( =MAX('MHF2'!B:B) )for the function to do so. I'd like to dispaly the data in the cell directly to the left of this number... How do I do this?
11302
21000
3484
4440
5428
6419
7367
8333
9315
10258...........
View 2 Replies
View Related
Apr 20, 2014
I am facing problem to make summary sheet of top 3 value from large number of value of my excel sheet like-
Sheet1
A
Group
B
Name
C
Value
1
Nashid
200145
[Code] ......
Now I want to make summary in sheet2 top 5 value among the list of sheet1 separately from group 1, 2 & 3.
If group number is 1 in sheet1 then top 3 value will be like this-
Group1
Name
Value
Nashid
200145
Jabed
184198
Eman
156622
If group number is 2 in sheet1 then top 3 value will be like this-
Group2
Name
Value
Rubel
172569
Hasin
152304
Monem
104463
If group number is 3 in sheet1 then top 3 value will be like this-
Name
Value
Romel
168251
Nasim
136357
Hasan
120410
View 1 Replies
View Related
Jun 17, 2014
I have an issue where I need to apply certain formats to a number of text strings which are domain names. This is purely for reporting purposes. I don't need to actually visit the url. This video demonstrates a bit more. [URL]
View 1 Replies
View Related
Oct 29, 2007
I am trying to sort in rows, a large number of rows. I can do text to columns, delimit by colon, and sort individual rows. But I have spreadsheets that are 100s of rows long. Is there anyway to automate?
View 4 Replies
View Related
Jun 13, 2008
I have problems in PASTING my 19 digit number from the source report into excel.
E.g, the original value is 8321515222222123122 but it always transfer to 8321515222222120000
I have tried the simple cell format setting, that is after pasting, I set the cells to text, but it doesn't help and also try the custom fomat "###################", but it is still the same result with the last 4 digit lost.
What I want the format to be is not in scientfic and have to be full display.
View 4 Replies
View Related
Mar 17, 2009
i have a spreadsheet with a certain data (rate of return) associated to a specific day of a year. (ex. 8-dec.-08 0.99865), and i have to calculate the rate of return (r) for every month, which is done by applying a formula (GEOMEAN) to all the rate of returns for the days of a month (ex. GEOMEAN(r[01 dec.]:r[31 dec.])).
i don't have any problems with that part. the hard part is that i have every single trading day from jan 00 to dec 08 (2000+ days), and i do not want to manually select the ranges. also, the dates do not include weekends (trading days per year = 252) which means that i cant (a) automatically determine a range or (b) automatically associate a number of days to a month (ex. oct 08 doesn't have the same amount of days as oct 07, because of the way week-ends and holidays are arranged..)
View 5 Replies
View Related
Apr 10, 2013
I have data in F6:AG6 raw filled with numbers as well as dates, i am looking for formula which can calculate a larger value of number format (excluding date format).
View 1 Replies
View Related