I am running software that calls an Excel macro using DDE. The macro populates a sheet with information to be printed, then prints the sheet.
I would like for this to take place in the background with Excel never taking focus from the software that calls the Excel macro. Currently Excel some times takes focus from the software and some times does not. The macro also takes the information it prints and stores it to another sheet, but I don't think that's the culprit stealing focus from the other software.
I would like to know if there is a way to print several different workbooks at once but keeping my printing format which I would like to be Landscape and Fit to one page. Reason is simple as I work in a office where staff is handed in several jobs to do everyday. They finish the jobs and log all the info on the database. I log on to database and put all their daily diaries and because it is all over the place I have to go in each file and set printing preferences which takes an hour in the morning and hour in the evening. I could do with some sort of automation where all diaries are automatically printed in Landscape and Fit on one page.
I have a report that is generated from a manufacturing process that looks like the example below. the report is 40 pages long when all the data is printed. i am looking for a way to only print this range if a dimension is "out of tolerance". if the dimension is within tolerance, there is always the "garbage" text of plus and minus. if every row is "within tolerance" in the range the cells in the OutTol column would all contain the "garbage" text but it will not always be identical. so, in summary, actual OutTol values = print and all "garbage" = not printed.
I attached an example excel sheet. I tried to figure out but could not get a way. I need a formula which takes the value in D2, search it in column A, if the value is in the list, type the corresponding result in E2.
I have this workbook and any other workbook open, but this workbook is not active. I click the X to shut down Excel. It calls the Workbook_BeforeClose event, then asks if I want to save my work (as it should). I select "Save All" and the shut down is aborted.
It never makes it to the Workbook_BeforeSave event.
I then click the X a second time, and I'm not prompted to save but the shut down proceeds with saving all and then closing Excel.
==> Why does it require a second click of the X?
If this workbook is active, all works fine.
I've commented out all event code. Didn't help.
I've deleted my commandbar menu before attempting to close.
The order in which the workbooks were opened doesn't matter.
What might I be doing in VB to cause this behavior?
This code is taking way too long to display the actions that it executes. It didn’t used to be that way. I was wondering if anyone knows why this may be. The Excel file is large – over 8 MB.
Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "N:N" Dim Cmnt On Error Goto ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target If .Row > 3 Then If Me.Cells(.Row, "N").Value = "" Or Me.Cells(.Row, "N").Value = "O" Or Me.Cells(.Row, "N").Value = "H" Then Me.Cells(.Row, "A").Resize(, 26).Interior.ColorIndex = 0 End If If Me.Cells(.Row, "N").Value = "C" And Me.Cells(.Row, "O").Value = "DR" Then Me.Cells(.Row, "A").Resize(, 26).Interior.ColorIndex = 39 End If If Me.Cells(.Row, "N").Value = "C" And Me.Cells(.Row, "O").Value = "HJB" Then Me.Cells(.Row, "A").Resize(, 26).Interior.ColorIndex = 6 End If.....................................
I have recorded 7 different macros and then combined them all into one macro to achieve one end result. I am not sure if you can just look at the codes to determine different ways to improve them or if you need the excel spreadsheet as well.
I am trying to create a macro that can take the average of the the first 24 cells within a sheet, place the answer onto a cell in the next sheet (e.g. sheet2 in cell A1), then go back to the previous sheet, take the average of the next 24 cells within the sheet and paste the average of this new set in A2. I want to create a loop that will do this 365 times.
I have only managed to create the following code, however its only obtainning the average for the first set of 24 cells starting from B6 in sheet 1. I dont know how to use offsets that well....
VB: Sub Oval1_Click() For i = 1 To 365 Sheets("H1 - Riser Turret pressure").Select Range("B4").Select ActiveCell.FormulaR1C1 = "=AVERAGE(Sheet1!RC:RC)" Range("B4").Offset(1, 0).Select Next i End Sub
Basically I need a formula that takes into effect many variables. It needs to check a size, thickness, and material, to determine a cost...
1.5 O.D. - 16GA - 304SS = $X
1.5 O.D. - 18 GA - 304SS = $Y
The problem I have is not only am I not understanding a lot of Excel jargon, the data set is not in perfect "example" conditions.
O.D. is in N:N yet there are blanks between N(x) and N(y), GA is in O:O yet blanks between O(a) and O(b), and so on.
Here is what I have at the moment, it uses a second sheet to derive the cost based on the parameters. Please ignore the first few terms, they are used with this cost lookup to give me my final. There also may be incorrect syntax in this, but since I get a nesting error first, I really don't know.
I want to obtain from some elements the number of cells it takes to appear: We have for example A,B,C, and D, and they appear in the next order:
1A 2C 3D 4A 5D 6B 7C 8A 9A
What I want to know is how much last in appear each element.
1A1 2C2 3D3 4A3 5D2 6B6 7C5 8A4 9A1
For example, the first “A” last one in appear, but the next element “C” last two in appear. In the forth line again cames the “A”, then are three cells. The “C” was in the cell2, and cames again in the seventh cell, then it takes five cells. In the cells eight and nine are two “A”, then in the cell nine takes one cell in appear again.
I plan to place a drop down list (combo box) in a WS where I upon selection of one item from that list will move me to the place in the same WS where the item selected is to be found. Hyperlinks are a theory, but the WS is protected and will stay protected. A drop down is preferred.
I haven't worked with this topics for quite some time and might have forgotten some basics.
I have a cell, lets call it A1, w/ an IF statement referencing another cell, which is a function of two values taken from RTD. A1 is either blank or reads "One." I want another cell to tally the # of times that A1 takes on the value "One."
The issue: I've tried approaching this by using Worksheet_calculate and an IF/Then statement to add 1 each time Range("A1") = "One" however this doesn't work because it keeps adding 1 while A1 reads "One." The calculations seem to fire off every milisecond, so if "One" flashes for 0.5 seconds, I get 500, and if it flashes for 3 seconds, I get 3000. For both cases, I'd like it to just add 1.
I've done quite a bit of searching in the forum and online and haven't found anything that's generic and can be used at anytime.
What I'm looking for is a way or for code that tells you how long it takes a macro to run from start to finish, something that can be used to time any macro. I've seen some threads in the forum where people indicate that it took x amount of seconds for their macro to run but not sure how to do it.
I have a very long if function that takes a value froma cell and then totals the row up to that point.... Is it possible to make this shorter? I have tried to put a sum function in there but that also comes with the nested functions have been exceeded error message...
Excel takes about 10 minutes in the saving process. When I say 10 minutes, I mean, the excel screen freezes (says not responding) for about 10 minutes, then it actually saves at the very end in the normal time any other file would take as you watch the progress bar go forward.
I know many of the common answers and have tried. reducing the calculation time (which in turn reduces the saving time).
But in my circumstance, the calculation takes a very reasonable amount of time, and you see the progress % going forward.
- I would say I have about 2000 rows, and 15 columns. - They have sumifs formulas. - They link to a different workbook. - The workbook I am working on saves to the network - the source of my sumifs are also in the same folder on the network - the recalculation takes about 10 seconds at most - i have turned off recalculate before saving, it is all on manual calcs
- when i hit save, there are no calcs being performed - there are no macros in the workbook - there are only about 2 names in the name manager - then it freezes for about 10 minutes. - then the progress bar starts moving then it saves.
What is it doing in those 10 minutes?
1 more item to note, when I break the links to the workbook and thereby removing the sumifs formulas, its a snap.
Why does the existence of the sumifs extend saving time? I would completely understand if it elongated calculation time, but if calculation is off, then why does it even worry about it when saving?
I delcare an array of dates and assign it with a function that returns an array of dates. Then I want to pass the result to a sub which takes an array of dates as a parameter. However, I am getting a type mismatch error on this line
I am using the below formula to distinctly count the number of customers that match the criteria that I have in Cells C7 and B10. The data is in a separate worksheet, that I am showing Named Detail of which will be changing on a monthly basis, so a pivot table does not want to be used. The detail data ranges from row 7-40,000, and the file is currently 8610KB's, and can potentially grow.
This formula works but takes an excessive amount of time for one caluclation, and I need this for multiple column and row critera. So, can this calculation be changed in order to get the same result with faster calculation time? I am using Excel 2003.
I have a spreadsheet that I have people fill in. A few columns have VLOOKUPS. I want to allow people to insert lines in this spreadsheet and have the formula automatically copy in the new line. It seems to already have that behavior for formatting and conditional formatting. Is there a way to also have that for formulas when inserting lines?
Name City Assigned Salesman ----------------------------------------------------- john Mountain View (formula using VLOOKUP) cindy Palo Alto (formula using VLOOKUP) ronnie sunnyvale (formula using VLOOKUP) ---------------------------------------------------
Insert line between john & cindy. Formula doesn't copy.
I ask them to copy the formula but they often forget. If I can make it a little more robust,
I have a fairly simple macro that takes a few seconds on my XP-computer with Excel 2003 but takes several minutes on my Vista-computer with Excel 2007.
The XP-PC has 2GB memory, the Vista-PC only 1GB, but it's hard to believe it's only that. Is Excel 2007 so much slower than 2003?
The macro makes quite extensive use of the .rows(Rownr).Delete method. Is the fact that 2007 has 1 million rows against the 65536 of 2003 the culprit? It has to shift much more data up when deleting a row, no?