I have a problem with the attached spreadsheet. I have certain letters (A,B,C etc.) that are shipped to various regions. I would like to have a count on top to count the total number of orders, but one that also counts the total number of unique orders. However, this unique count has to be dynamic and must be able to adjust accordingly to the filters (by default, if no other filters are applied, should be 15). For example, if I apply the "Ship To" filter to Canada, the total number should be 19, but the unique count should be 12. If I change the "Ship To" filter to US, the total number should be 9, and the unique count should be 7. I've tried to use the advanced filters but if I apply the unique entries filter, it is only a one time calculation. Also, the advanced filter gets rid of my other filters.
I have 3 pivot tables and with 3 filters each (they are all the same filters). I just want to change 1 of the filters for each of the pivot table (meaning the other 2 stay the same for all of the pivots). Is it possible to have a filter change automatically to match a filter in another pivot?
I'm trying to get the Find and FindNext methods to work. Column C contains serial numbers and there's a chance that a serial number might appear more than once in the column. What I'm trying to do is get Excel to find the first occurance of the serial number, find what row it's on and then see if this matches the variable 'CurRowNo' (defined earlier in the code). If it doesn't I want it to look at the other occurances of the serial number, find what row they're on and see again if it matches CurRowNo.
The variable 'EngCount is the number of occurances of the serial number (also worked out earlier in the code). I've got the code below, but I get the error 'Method Range of Object Global Failed' on the FindNext line. I have no idea what this error means or why it's happening.
i am trying to lookup up when ppart matches spart and subtract total shipped from total produced. Here is where I am getting stuck .... because spart has multiple returns LOOKUP(2,1/((I2=C:C)),J2)
Which is the best way import many (thousands of) files in text format into a single excel spreadsheet. Importing files with e.g. 50 lines to create 50 columns for rows for every file
I'm trying to create a workbook that will calculate times. Currently I have a worksheet that has, for example Incident #1, Date/Time In, and Date/Time Out. At the end of the row it will calculate total time in hours.
I need to create a second worksheet that will have Incident # to correspond to the incident # on Sheet1, with Date/Time In and Out. However, on this sheet there could be more than one occurance of Incident#1, and multiple times in an out. That total will be deducted from the total of incident#1 on Sheet1.
The easiest way to explain this would be...say for the sake of argument Sheet1 calculates the duration of a vacation in hours (lets say 168 hours). Sheet2 will calculate how much of that time was spent doing business (lets say 2 hours on day1, 3 hours on day 4). In the end I want to subtract 5 hours from 168 hours giving me 163 actual vacation hours.
My problem is, I don't know how to go about using the values in multiple rows in Sheet2 that correspond to the row in Sheet1.
i have created that will sort a db into dozens of sheets, now i need to be able to reset the process. There are 3 sheets i need, "balances", "trans", and "template". im unsure as to how define the sheet names so that the dSheet variable will recognize them. the way i have it now just deletes everything.
Sub reset() Dim dSheet As Variant Sheets(1).Select On Error Resume Next Do Until Sheets(1) dSheet = ActiveSheet.Name If Not dSheet Is "balances" Or "trans" Or "template" Then Application.DisplayAlerts = False ActiveSheet.Delete Application.DisplayAlerts = True Else ActiveSheet.Next.Select End If Loop End Sub
I have 134 parts and each part is available in 5 price groups - these are static items that need no calculation as they are completed on another worksheet. I have 400+ "items" each item is made up of various parts. I need to calculate the cost of each item. Hard to explain without example so I have attached an example.
I have made a spreadsheet but would love to be able to incorporate multiple 'Clear Data Buttons', (Macros) that clear cell data.
I have attached several screen shots of my spreadsheet, with the URLs listed below. (Images 1-6) http://tinyurl.com/qba57l http://tinyurl.com/od9upb http://tinyurl.com/ovaeej http://tinyurl.com/pctsvj http://tinyurl.com/oc2qqm http://tinyurl.com/qdhzge Spreadsheet (xls & xlsm) in zip format http://tinyurl.com/qczlap
It is a trading order sheet that I want to use, but also upload to a blog that I have just started, relating to trading as a free download, hopefully it may benefit some users/visitors etc.
OK, regarding the macros.
I'm not quite sure how it is best to do it. In total there are 13 'Clear Buttons.'
11 are 'CLEAR DATA' Buttons 12 is a 'Clear ONLY ORDER SHEET DATA' Button. Finally 13 is a 'Clear All DATA!' Button
I think it's best if I give the cell location of where I would like the macro buttons located and what data they clear. Clear DATA - Button 1 - (Is in Cell F3) - To Clear Data, Columns D,E,F & Rows 4 to 13) Clear DATA - Button 2 - (Is in Cell N3) - To Clear Data, Columns G to O & Rows 4 to 13) Clear DATA - Button 3 - (Is in Cell U3) - To Clear Data, Columns S,T & U & Rows 4 to 13) Clear DATA - Button 4 - (Is in Cell F15) - To Clear Data, Columns D,E,F & Rows 16 to 25) Clear DATA - Button 5 - (Is in Cell N15) - To Clear Data, Columns G To O & Rows 16 to 25) Clear DATA - Button 6 - (Is in Cell U15) - To Clear Data, Columns S,T & U & Rows 16 to 25)................................
I have a workbook that query's our case tracking database and pulls data into a csv. I am trying to write something that would do the following:
1) Prompt the user to enter in a case number 2) Open up the following file: -"C:Documents and SettingsDetails.csv" 3) Look through A:A for a match of the user entered number 4) If a match is found then pull the data from cell B in that Row 5) Output the data (from row b)into a text box on the user form along with the original entry made by the user.
How do i get this into a chart, with week along the bottom, Amount on the left. This is starting to be a pain now as i need to seperate by currency, but a pivot chart looks really realy messy with all the drop down boxes and stuff. I dont mind using drop don boxes, in fact, its going to be essential. but the pivot one look horrible.
about doing the opposite of consolidating multiple sheets into one: I have a large database and want each row of columns in their own new sheet. Rather than copying and pasting each row that I have, is there a code or formula to quickly command this to happen?
At Line 40, the program stops running. It asks for an object, but Im not sure why.
Also, I realized that there is an issue with sub twodeux copying the range selection from sheet1 of oldbook to the newly created sheet1(transfer template) of newbook. How can I cause the form to hold that selection of values until its ready to put them into the newbook? ....
I have created a form in excel. I now want to print the information from the form in 3 different ways from a custom buttom. The form is an invoice and
1. I want to print the entire sheet with all information including custom header and footer just as if the print icon from the toolbar was selected. 2. I want to print the second sheet the same as the first with the information of cell C21 replaced with upper case Xes except for 4 digits (this is the credit card Number) including header and footer (format in cell is 1111 2222 3333 4444 / 555 want to see XXXX XXXX XXXX 4444 / XXX) 3. the last printout I only want to print the following cells in their correct locations A6:C6 A7:C7 A9:G9 A10:G10 A26:E26 A27:E27 A28:E28 A28:E29 A30:E30 A31:E31
Also on this last sheet I want to change some items : Cell F26 to read PULLED BY and cells F27, F28, F29, F30, and F31 to be blank and no header or footer.
I would like to set up VBA codes to generate a variable number of transition matrices. I would like to know how I can define dynamic ranges instead of coding each and every range. In the codes below, I have to define each range one by one instead of using a loop.
Sub TransitionMatrix() Dim P1 As Range Set P1 = Cells(2, 2).Resize(3, 3) Dim P2 As Range Set P2 = P1.Offset(5, 0).Resize(3, 3) P2.Cells(0, 1) = "P2" For i = 1 To 3 For j = 1 To 3 P2.FormulaArray = "=MMULT(" & P1.Address & "," & P1.Address & ")" P2.BorderAround Weight:=xlMedium Next j Next i Dim P3 As Range Set P3 = P2.Offset(5, 0).Resize(3, 3)........................
I've created a very large spreadsheet (4096 calculations) and I'm using array formulas for a large number of cells, which leads me to my current predicament. All the formulas are written in, but I haven't done the necessary ctrl+shift+enter after finishing all of them (there is only slight variation in each calculation so I produced them in an iterative manner) and I was wondering if there was a way besides selecting each cell individually - pressing F2 - Then pressing CTRL + SHIFT + ENTER to make all my formulas array formulas.
What I have is a spreadsheet with a names column A and purchasing information in columns B-AA pertinent to the name in A. Additional information pertinent to the same name in Cell A1 exists in B2:AA2, or 3 etc. depending on the number of purchases made by the name in column A. The spredsheet is well over 100,000 rows long. Is there a method of copying the names so that each purchase has the correct name associated with it in the corresponding (currently empty) cell in column A? .....
I was able to come up with a formula that returns multiple results when indexing rather than just the first match.
Now the problem I have is that my source table is going to vary in size. My source table in the formula I got working below is a dynamically named range 'ImportedData'. The data in this table will always start on Row 8 but the last row of the table will vary, so the bold/red areas of the formula need to be dynamic.
how I might modify this formula to allow for the dynamic table size?
Trying to load an array from user selected items in a listbox
My code returns Type Mismatch error
I don't know why as a I did not declare type for the array I thought treated as variant so should accept any values?
Debug:
arrSelected(intI) = .Selected(intI)
Private Sub btnOK_Click() Dim arrSelected Dim intI As Integer With Me.lstAccounts For intI = 0 To .ListCount - 1 If .Selected(intI) Then arrSelected(intI) = .Selected(intI) End If Next intI End With
I wrote a macro so that if a checkbox is "true" it will print and if it is "false" then the checkbox will not print. I want to do that on many other checkboxes but with this approach the number of macros will have to be equal to the number of checkboxes. I was wondering if someone here by writing one macro that will do the trick and i can assign to as many checkboxes as i want. my macro is
Sub proPaintRALPEnd() Application.ScreenUpdating = False On Error Resume Next If Range("l78").Value = "True" Then ActiveSheet.Shapes("Check Box 697").Select With Selection .Placement = xlMove .PrintObject = True End With ActiveSheet.Shapes("Text Box 698").Select With Selection .Placement = xlMove .PrintObject = True End With Else...............
writing a macro to find the max value in each column and delete all the data points that come after it (or preferably: delete all the data points that come 2 rows down after the max, if possible). There will be many columns of data where the max will come at different positions in the column.
Instead of deleting post-max values, it would also be acceptable to just copy values from the beginning to the max to the same column in a new worksheet.
Code copies the first two columns of a many column table and pastes them at a certain interval (14 columns) to make transfer to a report easy. The problem is that the worksheets each have a different number of columns, but none more than 56 columns. The macro works wonders on the first sheet, but thereafter does not work at all. The first sheet has 27 columns, the second sheet only has 4 columns and the one after has 38 or something.
Option Explicit
Public iMaleGroup As Integer Public iFemaleGroup As Integer Public iMaleAnimal As Integer Public iFemaleAnimal As Integer Public iMaleGroup1 As Integer Public iFemaleGroup1 As Integer Public StudyTitle As String Public SmallAnimal As Boolean
Sub CommandModule()
Dim Wrkst As Worksheet Dim wsName As String Dim wsSubject As String Dim wsNumber As String Dim rSummaryHeader As Range Dim MergedHeader Dim NextMergedHeader Dim HeaderRange Dim AddHeader Dim TableHeader Dim SumTableHeader Dim PasteRange Dim x As Integer Dim n As Integer Dim z As Integer Dim i As Integer
My workbook holds a month template and sheets for each month. I work on modifications in the template ,but would then like to update all the monthly worksheets. I recorded a macro to show me how to start programming the vb sub, but get a runtime failure 'error 1004 Select method of range class failed' when trying to select the column to copy,