![]() |
summarising information in a workbook on a new worksheet
i have a worksheet that details the sales to customers. From a userform i
need a command button to open a form that asks for start and finish dates. These dates need to be used to show all the sales made in this period and be displayed on a new worksheet |
summarising information in a workbook on a new worksheet
Private Sub CommandButton1_Click()
Dim strColumn1 As String Dim strColumn2 As String strColumn1 = "A1" strColumn2 = "B1" Worksheets("sheet1").Range(strColumn1).Value = Me.TextBox1.Value Worksheets("sheet1").Range(strColumn2).Value = Me.TextBox2.Value UserForm2.Hide End Sub Private Sub UserForm_Activate() Dim StartDate As String Dim EndDate As String StartDate = "Enter a Starting date...Example 1/1/2007" EndDate = "Enter a Ending date..Example 1/1/2007" MsgBox StartDate & vbCrLf & EndDate End Sub "SDH" wrote: i have a worksheet that details the sales to customers. From a userform i need a command button to open a form that asks for start and finish dates. These dates need to be used to show all the sales made in this period and be displayed on a new worksheet |
summarising information in a workbook on a new worksheet
Thank Mike, but perhaps i didn't explain the function required correctly. So
here is a bit more detail. I have a UserForm1 with a cmdUpdateSummary button on it. The Workbook has two sheets Products and Clients. The Clients sheet has a list of details of sales made with the date of sales in column F. What i need is when the cmdUpdateSummary is clicked to ask for the start and finish date of sales to report in a new worksheet 'Summary' with all those details of the dates that meet the criteria to be presented. "Mike" wrote: Private Sub CommandButton1_Click() Dim strColumn1 As String Dim strColumn2 As String strColumn1 = "A1" strColumn2 = "B1" Worksheets("sheet1").Range(strColumn1).Value = Me.TextBox1.Value Worksheets("sheet1").Range(strColumn2).Value = Me.TextBox2.Value UserForm2.Hide End Sub Private Sub UserForm_Activate() Dim StartDate As String Dim EndDate As String StartDate = "Enter a Starting date...Example 1/1/2007" EndDate = "Enter a Ending date..Example 1/1/2007" MsgBox StartDate & vbCrLf & EndDate End Sub "SDH" wrote: i have a worksheet that details the sales to customers. From a userform i need a command button to open a form that asks for start and finish dates. These dates need to be used to show all the sales made in this period and be displayed on a new worksheet |
All times are GMT +1. The time now is 01:56 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com