Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-20-2017, 11:24 AM
walber walber is offline Help with code VBA Windows 10 Help with code VBA Office 2016
Novice
Help with code VBA
 
Join Date: Jan 2017
Posts: 3
walber is on a distinguished road
Default 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
Attached Images
File Type: png Sem título.png (9.3 KB, 19 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with code VBA 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
Help with code VBA QR-code qrcode Word 3 05-26-2015 06:38 AM
Help with code VBA Need Help with Below Code rsrasc Word VBA 6 04-01-2014 03:42 PM
Help with code VBA Where does my code go? rbaldwin Word VBA 3 03-14-2012 02:31 PM
Help with code VBA vbc code rajpeter Excel Programming 2 09-13-2011 02:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft