Hi Everyone, This is my first post here so I hope I am not asking for too much.
I am creating an invoice in excel for our contract emloyees to use when invoicing their expenses. There are 2 tables: one Invoice Table for the employees to add their individual expenses and select a specific category (Food, Transportation etc) for that expense, and one Expense Category Totals table that calculates the sum of each expense category.
For the second table I would like any rows to be hidden where expense category total (in column D or 4) would be 0. And of course if the user adds an expense in that category I need it to reapear if the value becomes more than 0.
The other factor is that the Invoice Table above where users are adding the expenses has an "Add Row" button. So for every row added to the Invoice Table, the Expense Category Totals table is moved down by 1 row. I was using column A as a hidden column to list the cell ranges of the Expense Category Totals table (starting row of table in cell A2, ending row of table in cell A3).
Here is what I had currently:
Sub HIDESUMROWS()
BeginRow = (Range("A2"))
EndRow = (Range("A3"))
ChkCol = 4
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value > 0 Then
Cells(RowCnt, ChkCol).Select
On Error Resume Next
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Thank you for any help you can provide on this, I sincerely appreciate any feedback! If it helps to include the invoice or screen shot of it, please let me know.
Stacey
I am creating an invoice in excel for our contract emloyees to use when invoicing their expenses. There are 2 tables: one Invoice Table for the employees to add their individual expenses and select a specific category (Food, Transportation etc) for that expense, and one Expense Category Totals table that calculates the sum of each expense category.
For the second table I would like any rows to be hidden where expense category total (in column D or 4) would be 0. And of course if the user adds an expense in that category I need it to reapear if the value becomes more than 0.
The other factor is that the Invoice Table above where users are adding the expenses has an "Add Row" button. So for every row added to the Invoice Table, the Expense Category Totals table is moved down by 1 row. I was using column A as a hidden column to list the cell ranges of the Expense Category Totals table (starting row of table in cell A2, ending row of table in cell A3).
Here is what I had currently:
Sub HIDESUMROWS()
BeginRow = (Range("A2"))
EndRow = (Range("A3"))
ChkCol = 4
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value > 0 Then
Cells(RowCnt, ChkCol).Select
On Error Resume Next
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Thank you for any help you can provide on this, I sincerely appreciate any feedback! If it helps to include the invoice or screen shot of it, please let me know.
Stacey