• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Designing a Table using Combo-boxes and Command buttons

Hello All,
Can we design a table in Excel 2013 using developer tools such that:

1. There should be 7 columns in the table.
2. There should be a Combo-box for selecting the month (Jan to Dec)
3. There should be two Command buttons one named "Total" and another named Refresh.
4. Pressing Total button calculates total in the last empty cell available for the particular column and copies and paste's the totals of Product A, Product B and Product C for suppose January into a new worksheet in the same workbook.
5. Pressing Refresh button, clears all data in the first sheet ready for another month's entry.
Anyone interested to help me with this? I've done the bare basics and uploaded the Excel file. Only need help with the macro programming.
Greatly appreciate any responses.
Regards,
~Maneesh
 

Attachments

Attempting to do it myself:
Here's what I've come up with for the Copy button:


Sub Button2_Click()

Sub CopySource()
Dim rngSource As Range
Dim rngTarget As Range
Dim iRow As Integer

Set rngSource = Worksheets("Sheet1").Range("SourceData")
iRow = Worksheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row + 1
Set rngTarget = Worksheets("Sheet2").Range("A" & iRow)
rngSource.Copy Destination:=rngTarget

End Sub

This gives me a "Subscript Out of Range" error.
Please help with the macro.
~Maneesh
 
Back
Top