I have data that is formatted in an Excel 2010 table. The two columns in question are [Invoice #] and [Description]. In the description column I have descriptions of products as well as freight. The same invoice number would be tied to the product description as well as its associated freight. I need to filter out certain product types and their associated freight items.
The macro I wrote creates an array of invoice numbers that I want to filter out and leave the remaining invoices, but I can't get the filtering part to work. Here is my code:
Dim Invoices() As Variant 'array of invoice numbers Dim Descriptions() As Variant 'array of Descriptions Dim InvoiceFilter() As Variant 'array of invoice numbers to filter Dim i As Integer 'counter Dim j As Integer j = 1
What happens now is that it filters out all values in the Invoice column instead of only the values in the InvoiceFilter array.
I am trying to send bulk emails from my excel 2010 - however I am getting a POP UP. find the screen shot in the enclosed word document So every time a new mail is sent from excel we need to press the button allow Is there a way where I can turn off this warning.
I'm designing a form to look at data contained on a spreadsheet. I aiming for the user to select filter criteria which will then be used to reduce the data based on the criteria selected using autofilter. How can I set the filter criteria using a form to give the same options as when you manually select the filter using the arrows at the top of the row? Can I get the filter selections into a list box?
This code does not work the way I expect it to. Presently it just causes Excel to freeze.
The idea is that if you double-click a cell within the CurrentRegion (starting at A1) that AutoFilters will be applied and the selection criteria will be the target value:
Code: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim MyRng As Range Dim MyCol As Long Set MyRng = ActiveSheet.Range("A1").CurrentRegion MyCol = Target.Column If Not Application.Intersect(Target, MyRng) Is Nothing Then ActiveSheet.AutoFilterMode = False MyRng.AutoFilter Field:=MyCol, Criteria1:=Target.Value, Operator:=xlFilterValues Cancel = True End If End Sub
Is it possible to retrieve an arrary of the autofilter criteria. I know this is possible in pre 2007 but with 2007 onwards I can't find a way of doing it.
I know I can get all the available items in a list by using the scripting.dictionary and also by using the visible cells I could see what could be filtered but that is not really accurate for what I want.
If I have multiple columns and look at the filtered information in one column I can retrieve an array of the visible cells from that column but that is not necessarily the criteria that is in the column. i.E. If another column has a filter rows may be filtered that would have otherwise been visible.
I got a problem using AutoFilter with VBA in Excel.
It works well for regular filters, but filtering the date column does not work as intended. The column is formatted as date, I can filter it manually and absurdly, if I run my code, it filters nothing but when I check the filter and then only click ok (no change being applied to the filter criteria), it starts filtering correctly.
with this code, how can I make my combobox1 starts with the last record ??
Private Sub UserForm_Initialize()Dim cell As RangeWith Worksheets("Sheet1")For Each cell In .Range("C2:C" & .Cells(Rows.Count, 3).End(xlUp).Row)If Not IsEmpty(cell) Then ComboBox1.AddItem cell.ValueNext cellEnd With
I'm working with three large data sets covering a month of data in 5 minute intervals. There is a single date and time column which I am using some custom formats to list Time in 12 hour format, AM or PM and Day of the week.
Based upon the various analysis scenarios, adding some Autofilter columns is meeting most of my needs. One issue I am having is that I can filter on a single day using the built in list that Autofilter provides. But I have been asked to look at weekend vs weekday.
Since Excel 2003 only offers two filter criteria, I thought I could use a custom filter with Saturday and Sunday as include or exclude criteria. But, what I am findings is that while the Autofilter shows each day in the dropdown, certain attempts to use them within the custom autofilter do not work.
For example, equals Saturday and equals Sunday correctly returns only weekend data. However, if I try changing both to Does not equals, the result is that no data is filtered.Some of my research indicates that the problem is that the date information being presented as days of the week would need to be text strings . This seems to shed some light on the issue as any attempts at using wildcards fail.
I am using Excel 2013. I have an autofilter turned on for the columns in the spreadsheet. When I click on the filter button at the top of a column, the filter values do not have any check boxes next to them so I can't check any values. how to fix it so that it has checkboxes? I've attached a screen shot.
I would like to have a question box pop up w/Yes and No Buttons at the start of my macro to choose between two different sub routines. Therefore, MsgBox would say: Import New Yard Inventory?
If Yes, then it would run the alternate subroutine. If No, Then it would run macros normal routine. Not quite sure how to do this. Would the msg box have to be a form box where, a representive value would have to get filled into a cell? Then reference if cell value is true ,then or would it register the value to memory so then, the code would have to to call the given value then run code if value it true?
Is there a formula that I can use to sort the data in numerical order by the last digits exactly like the first dataset? There are all sorts of veriations of the first digits and the last, but the "-TP-" always remains constant.
Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range If Not Intersect(Target, Range("e273:g284")) Is Nothing Then Set rng = Range("e273:g284") ElseIf Not Intersect(Target, Range("g273:j284")) Is Nothing Then Set rng = Range("g273:j284") ElseIf Not Intersect(Target, Range("j273:l284")) Is Nothing Then Set rng = Range("j273:l284") End If Application.EnableEvents = False If Not rng Is Nothing Then If Application. CountIf(rng, Target.Cells(1, 1).Value) > 1 Then MsgBox "This vehicle is booked out at this time" Target.ClearContents Target.Cells(1, 1).Select End If End If Application.EnableEvents = True End Sub
the code is perfect for what i need it to do but the only problem i have is that the codes roll on from each other... I.E:- E273:G284 - G273:J284 - J273:L284. first ends in G second starts in G, Second ends on J third starts on J. for some reason this doesnt work, the first code gets the prority and works but the second works in all the columns except the first one.. in this case the first code is fine, second actually works from H not G and third works from K not J
I was wondering if it is possible to have cells formatted based on the presence of an autofilter? I have a large worksheet, and to clean it up I would like to make the entire sheet (minus the category headers) invisible. Then, when the user applies a filter, the cells become visible.
I have a workbook and I want to check in a cell, if the value in the cell starts with "S" or "D". In VB.net there is a method .StartsWith to check the starting letter in a file. Is there a way to check the starting letter in the cell?
So I added a x-y scatter series to a line chart (in order to add a vertical line to the chart) and now I'm having a problem with the x-axis. It lets me select the start and end date, but when I put it on auto is starts 1 day before the data does. For example, if my data starts on 5/1/2011, the x-axis starts on 4/1/2011 and the there is no data point at that date.
I could manually change this, but the data is dynamic so the start date changes. Since I can do formulas in the format axis tab (date+1).