![]() |
Heading for Report from UserForm.
Hi,
I have a userform with some textboxes and comboboxes to get view the information by selecting by textboxes and cobos. and have a BuildReport button to find and filter the records from worksheet. buttons are like this: Filter Criteria: ============ 1 CoboCategory: 2 CoboLocation: 3 CoboSection: 4 TxtDate: And I have a button Private Sub BuildReport_Click() Sheets("Purchase").Select Range("AT5:BH65500").Select Selection.Copy Sheets("RepPurchase").Select Range("A3").Select ActiveSheet.Paste Range("A3").Select Sheets("RepPurchase").Range("H1") = CoboSection.Value ' =========================================== Sheets("Purchase").Select Range("A1").Select End Sub I am using the above code to copy the filtered data to "RepPurchase" sheet Now the problem is this if I will use the above command then H1 shows the name of the Section which I select, and If I select the CoboCategory or CoboLocation how to show the different critaria in H1 as Heading of the Report. Please help me to prepare heading for the searched critaria. Thanks and regards. Shahzad KSA. |
Heading for Report from UserForm.
Select Case True
Case Trim(CoboSection.Value) < "" Sheets("RepPurchase").Range("H1") = CoboSection.Value ' =========================================== Case Trim(CoboLocation.Value) < "" Sheets("RepPurchase").Range("H1") = CoboLocation.Value ' =========================================== Case Trim(CoboCategory.Value) < "" Sheets("RepPurchase").Range("H1") = CoboCategory.Value ' =========================================== Case Else Sheets("RepPurchase").Range("H1") = "All Data" ' =========================================== End Select -- Regards, Tom Ogilvy " wrote: Hi, I have a userform with some textboxes and comboboxes to get view the information by selecting by textboxes and cobos. and have a BuildReport button to find and filter the records from worksheet. buttons are like this: Filter Criteria: ============ 1 CoboCategory: 2 CoboLocation: 3 CoboSection: 4 TxtDate: And I have a button Private Sub BuildReport_Click() Sheets("Purchase").Select Range("AT5:BH65500").Select Selection.Copy Sheets("RepPurchase").Select Range("A3").Select ActiveSheet.Paste Range("A3").Select Sheets("RepPurchase").Range("H1") = CoboSection.Value ' =========================================== Sheets("Purchase").Select Range("A1").Select End Sub I am using the above code to copy the filtered data to "RepPurchase" sheet Now the problem is this if I will use the above command then H1 shows the name of the Section which I select, and If I select the CoboCategory or CoboLocation how to show the different critaria in H1 as Heading of the Report. Please help me to prepare heading for the searched critaria. Thanks and regards. Shahzad KSA. |
All times are GMT +1. The time now is 06:15 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com