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?
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?
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?
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.
I have a long complicated macro that processes a ton of data and gives the output in a new sheet. I then want to create new buttons (or some sort of user clickable triggers) on this new sheet that runs another macro.
I have got the actual adding of buttons in the sheet working, but I can't find a way to automatically assign macros to newly generated buttons during runtime. Is this even possible (or are there any clever tricks I could use to get around this?)
Essentially, I am working with a database for a school and up until this point, each row matches up to a student with a bunch of information on them. One of these pieces of info is their parent's names. This is a much simplified look at things, but the screenshot below is a basic version of what everything looks like:
Now, the school wants me to split up the parents names from the student's and place them in their own row. I have recorded a macro to do this where you make the active cell the "full name" column for the row you want to expand, and then run the macro. Afterwards, up to two more rows are added, with the parent's names and some data copied. Below is a screenshot of what that looks like: (yellow is the new data generated, and blue is the active cell I marked to run the macro properly)
The issue is that there are thousands of these that need to be done, and I figured there is a way to do this with a macro. The issue is that not every row has parents names to expand out.
In layman's terms, I need a macro that will look at the two columns titled "Father's Name" and "Mother's Name" on each row of the spreadsheet and then, if there is any data in both or either of them, it should set the active cell to the "Full Name" column for that row then run the macro accordingly. After that it should repeat this all the way down, skipping any where neither of the columns have text in them
In the actual spreadsheet, the columns that need to be checked are AW and AX, and the column that needs to be set to the active cell before running the macro is B.
i need to make a macro that takes workbooks or files and runs them through another macro. i already have the 2nd macro done and it is working perfectly i just need to know how to make the one that finds the other files and runs them all through the macro i already made. My boss said that he will have about 150-200 files to run through this macro.
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.
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.
It copies certain sheets out of a workbook (for a new workbook) Unprotect the sheets in the new workbook Deletes a particular cell on each sheet Unhides a sheet Sets all of the new worksheets to normal view Protects the new sheets Lets the user save and name the new workbook.
All is working fine Except it will not change the new workbook from Page Break View to Normal view.
The code I'm using = Sheets("name").Activate Activewindow.View=xlNormal
Here's the strangest part. When I run the macro from a command button, the newly created workbook retains the page break view (as is in the original).
When I run the macro line by line via F8, IT WORKS JUST FINE
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)
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.
I have a macro which reads data from a large number (up to 500) of books in a folder. This extracted information is subject to some fairly heavy analysis which means that the macro runs very slowly as the sheet is constantly calculating.
I would like to add some code - maybe after 'screen updating = false' - that would turn off auto calculation while the macro runs and then restore it once the macro is finished.
i have a button on my workbook1 that opens another workbook (lets call it workbook2) and automatically runs a macro on opening it. Once opened i have a button on workbook2 to close itself. I then go back to see workbook1. This all works but then when i click on the button to open the workbook2 again it opens but the macro does not run.
I searched for this and found a few examples on splash screens, but if someone could help I would appreciate it.
Basically I have this massive macro that runs, I recorded some of it, and VBA the rest. It does a bunch of things like bringing in different spreadsheets, formatting vlookups blah blah blah... Anyway for a nice touch I was hoping that I could get a splash screen or something that will run while this macro is running in the background. How hard would this be? The macro is button driven...
I have a macro in my worksheet that runs as a change event on certain comment cells. This macro unprotects the worksheet, expands the merged comment cell that just change, and re-protects the worksheet. The cell expansion works great. When I re-protect the worksheet all of the cells work correctly, except the cell that was just changed. Any other "unlocked" cell in the document stays unlocked after the protection is applied, but the cell that just changed becomes locked. I need this cell to remain unlocked to allow the user to update the comments. Here is my full
I have a spreadsheet that is made up of single line items with sub-totals at various points going down the sheet (ie the spreadsheet is split into sections)
Each section is about 100 rows long and 40 columns wide, 10 of which are sub-totals, all using the same formula from that i enter in column A.
As i add new sections i have recorded a simple macro that copies the active cell (ie A15 for example). It then pastes into D15, F15, H15, N15, X15 and then returns to A15. I have linked this up to ctrl X for ease of running.
I have around 500 section totals to "ctrl X", per spreadsheet and 10 spreadsheets to do in total. I have firstly filtered all the line items (rows) out to leave me just the sub-totals to [ctrl x] [arrow down] [ctrl x] [arrow down] [ctrl x] etc etc etc.... Is there anyway to automate this process, i have tried recording another macro of me [ctrl x] [arrow down] about 30 times, but when i run it, it pastes on the hidden rows, not just on what you see on the screen. Is there a bit of code i can enter so it only sees what is visible.??
I have a peice of code which opens up a number of Workbooks (200+) and updates a series of control tables in each. Given our security etc environment, links and external references etc are not possible. The target files must all be standalone and self-sufficient.
The problem I have is that when I run the procedure in question in the usual way, the procedure simply terminates after the first file is opened. No error messages, no distress - it just stops. I have put debugging calls all around the "Workbook.Open" call, and it simply doesn't make it out of the call. There is no Auto_Open code in the workbooks being opened and (as I indicated above) no external links, references or function calls.
What's weird is that if I step through the procedure in the Command Debugger, everything works fine. Even weider, if I complete step-by-step processing on the first target file then I can press "Play" and the code will complete execution and process all the remaining files without error.
I have rebuilt/recreated/re-ordered the target files and even moved them to a different volume.
If anyone has seen this before, or has any idea what the cause may be, or even just a wild idea, I'd love to hear it.
Code segment attached.
* '*** Process each file in the list provided '* For intCounter = 1 To intWBS_Files
I have a button. When pressed, it runs a macro. Instead, after pressing the button, I would like the user to confirm to run the macro and display some info about it. This is to make sure the user does not accidentally run the wrong macro (button). I just need a prompt box, with a line info, and the two choices YES and NO. If NO is selected, nothing happens. If YES is selected, macro continues.
I got a code that makes an animated userform popup (web browser in userform). that works smoothly. but, when I have that code before two more codes. The userform does show, but the animation does not. Until all the following two codes are finished running. The purpose was to have the animation running while the two codes are being processed.
Main Code: Code with 3 different codes.
Private Sub cmdAdd_Click() Dim iRow As Long If Sheets("LookupLists"). Range("N2").Value = "EXACT" Then Application. ScreenUpdating = False ' Loading user form popup Call ShowFrm Call CopyEmplInfo End If Call MergeCells End Sub
This macro ran fine until I started using Offset on ranges to have them extend. The macro replaces "L" with blanks but does not go on to delete the rows. The name "Type" refers to =Offset(Mem05!$A$2,0,0, CountA(Mem05!$A$2:$A$270),10)
Relevant part of Macro wb06.Activate Application.Goto Reference:="Type" Selection.Replace What:="L", Replacement:="", LookAt:=xlWhole, _ SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _ ReplaceFormat:=False On Error Resume Next
I have a spreadsheet with sales figures for a company over a few months. I want to create a macro that will insert a new month after the last month. I have got it to work for the first month but after that it will just insert 2 black cells after.
i have a named cell called Average_slales_per_month that is next to the last month all the time.
I have a workbook that contains 9 worksheets. Four of the worksheets have the same row lables in column B and must always be the same. Three of the worksheets are fed from the 4th sheet so that the integrity of the lables is maintained.
The user can change the lable value to meet their needs and they can insert or delete rows (within limits) as they see fit.
The attached macro "Sub Delete_Row_All_Sheets()" works fine when I run it from Debug (F8).
However, when I run it from Forms.ComboBox the macro returns to the "y = Application.InputBox("Enter The Row Number You Wish To Delete", _" screen. If I select cancel, the results I anticipated occur but I don't want the user to have to assume this will happen.
Why does the macro return to this screen when executed from the ComboBox but not when executed from Debug?