#1
|
|||
|
|||
Help with code VBA
I would like that when the month and year are selected when clicking on the sales button pull all data refent to the month and year chosen listview form according to the image.
This is the command that I want to adapt this option. Private Sub CmdSales_Click() With ListView1 .Gridlines = True .View = lvwReport FullRowSelect = True .ColumnHeaders.Add Text:="date", Width:=60 .ColumnHeaders.Add Text:="description", Width:=200, Alignment:=2 .ColumnHeaders.Add Text:="amount", Width:=60, Alignment:=2 .ColumnHeaders.Add Text:="value", Width:=40, Alignment:=2 .ColumnHeaders.Add Text:="amount", Width:=60, Alignment:=2 End With last line = Plan3.Cells(Plan3.Cells.Rows.Count, "a").End(xlUp).Row ListView1.ListItems.Clear For x = 5 To last line Set li = ListView1.ListItems.Add(Text:=Plan3.Cells(x, "a").Value) li.ListSubItems.Add Text:=Plan3.Cells(x, "c").Value li.ListSubItems.Add Text:=Plan3.Cells(x, "d").Value li.ListSubItems.Add Text:=Plan3.Cells(x, "e").Value li.ListSubItems.Add Text:=Plan3.Cells(x, "f").Value Next End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA Code to search for field codes with certain text before the Field code and to change style | welcometocandyland | Word VBA | 4 | 02-08-2017 06:53 PM |
QR-code | qrcode | Word | 3 | 05-26-2015 06:38 AM |
Need Help with Below Code | rsrasc | Word VBA | 6 | 04-01-2014 03:42 PM |
Where does my code go? | rbaldwin | Word VBA | 3 | 03-14-2012 02:31 PM |
vbc code | rajpeter | Excel Programming | 2 | 09-13-2011 02:29 PM |